3DRadSpace 0.1.0Alpha
3DRadSpace is a free, simple to use, rapid application development game engine.
Loading...
Searching...
No Matches
Engine3DRadSpace.Physics.ICharacterController Class Referenceabstract

Represents the interface for character controllers in physics engine implementations. More...

#include <ICharacterController.hpp>

Inheritance diagram for Engine3DRadSpace.Physics.ICharacterController:
Collaboration diagram for Engine3DRadSpace.Physics.ICharacterController:

Public Member Functions

void Move (Vector3 displacement)
void Jump (float height)
bool IsGrounded ()
 ICharacterController (IntPtr natPtr)
virtual void Move (const Math::Vector3 &displacement)=0
 Move the character with the specified displacement.
virtual void Jump (float height)=0
 Try to jump the character with the specified height.
virtual float GetHeight () const =0
 Gets the height of the character controller capsule collider.
virtual void SetHeight (float height)=0
 Sets the height of the character controller capsule collider.
virtual float GetRadius () const =0
 Gets the radius of the character controller capsule collider.
virtual void SetRadius (float radius)=0
 Sets the radius of the character controller capsule collider.
virtual void SetMaxSlopeAngle (float angle)=0
 Sets the maximum slope angle the character can walk on.
virtual float GetMaxSlopeAngle () const =0
 Gets the maximum slope angle the character can walk on.
virtual void SetGravity (const Math::Vector3 &gravity)=0
 Sets the gravity affecting the character.
virtual Math::Vector3 GetGravity () const =0
 Gets the gravity affecting the character.
virtual bool IsGrounded ()=0
 Checks if the character is grounded.
 ~ICharacterController () override=default
Public Member Functions inherited from Engine3DRadSpace.Physics.ICollider
IPhysicsEngine GetPhysics ()
bool ApplyForce (Vector3 force)
bool ApplyForce (Vector3 force, Vector3 center)
bool ApplyTorque (Vector3 force)
bool ApplyAcceleration (Vector3 acc)
bool ApplyAngularAcceleration (Vector3 acc)
float? Intersects (Ray r)
void UpdateTransform ()
void UpdateTransform (Vector3 position, Quaternion rotation)
 ICollider (IntPtr natPtr)
virtual float GetMass () const =0
 Gets the mass of this collider.
virtual void SetMass (float mass)=0
 Sets the mass of this collider.
virtual Math::Vector3 GetPosition () const =0
 Gets the position of this collider.
virtual void SetPosition (const Math::Vector3 &position)=0
 Sets the position of this collider.
virtual Math::Quaternion GetRotation () const =0
 Gets the rotation of this collider.
virtual void SetRotation (const Math::Quaternion &rotation)=0
 Sets the rotation of this collider.
IPhysicsEngine * GetPhysics () const noexcept
 Gets the physics engine that this collider is associated with.
virtual std::optional< float > Intersects (const Math::Ray &r)=0
 Returns the distance from the ray origin to the intersection point if the ray intersects with this collider, or std::nullopt if there is no intersection.
virtual void UpdateTransform ()=0
 Update the transform of this collider in the physics engine. This method should be called after changing the position or rotation of the collider to ensure that the physics engine is aware of the changes.
virtual void UpdateTransform (const Math::Vector3 &position, const Math::Quaternion &rotation)=0
 Update the transform of this collider in the physics engine with the specified position and rotation. This method should be called after changing the position or rotation of the collider to ensure that the physics engine is aware of the changes.
virtual ~ICollider ()=default
Public Member Functions inherited from Engine3DRadSpace.NatPtrWrapper
virtual void Dispose ()

Protected Member Functions

 ICharacterController (IPhysicsEngine *physics)
 ICharacterController (ICharacterController &&) noexcept=default
ICharacterController & operator= (ICharacterController &&) noexcept=default
 ICharacterController (const ICharacterController &)=delete
ICharacterController & operator= (const ICharacterController &)=delete
Protected Member Functions inherited from Engine3DRadSpace.Physics.ICollider
 ICollider (IntPtr natPtr, bool ownsHandle)
 ICollider (IPhysicsEngine *physics)
 ICollider (const ICollider &)=delete
ICollider & operator= (const ICollider &)=delete
 ICollider (ICollider &&) noexcept=default
ICollider & operator= (ICollider &&) noexcept=default
Protected Member Functions inherited from Engine3DRadSpace.NatPtrWrapper
 NatPtrWrapper (IntPtr handle, Action< IntPtr > fnDestroy)
 NatPtrWrapper (Action< IntPtr > fnDestroy)
void Reset (IntPtr newObj)
void Dispose (bool disposing)

Protected Attributes

float _height
float _radius
float _maxSlopeAngle = std::numbers::pi_v<float> / 4.0f
Math::Vector3 _gravity
Protected Attributes inherited from Engine3DRadSpace.Physics.ICollider
IPhysicsEngine * _physics
float _mass = 1.0f
Math::Vector3 _position
Math::Quaternion _rotation
Protected Attributes inherited from Engine3DRadSpace.NatPtrWrapper
IntPtr _handle
bool _disposed

Properties

float Height [get, set]
float Radius [get, set]
float MaxSlopeAngle [get, set]
Vector3 Gravity [get, set]
Properties inherited from Engine3DRadSpace.Physics.ICollider
float Mass [get, set]
Vector3 Position [get, set]
Quaternion Rotation [get, set]
float LinearDamping [get, set]
float AngularDamping [get, set]
float StaticFriction [get, set]
float DynamicFriction [get, set]
float Restitution [get, set]
Vector3 LinearVelocity [get, set]
Vector3 AngularVelocity [get, set]
Vector3 MaxAngularVelocity [get, set]
Properties inherited from Engine3DRadSpace.NatPtrWrapper
IntPtr Handle [get]

Detailed Description

Represents the interface for character controllers in physics engine implementations.

Constructor & Destructor Documentation

◆ ICharacterController() [1/4]

Engine3DRadSpace.Physics.ICharacterController.ICharacterController ( IntPtr natPtr)
inline

◆ ICharacterController() [2/4]

◆ ICharacterController() [3/4]

◆ ICharacterController() [4/4]

◆ ~ICharacterController()

Engine3DRadSpace.Physics.ICharacterController.~ICharacterController ( )
overridedefault

Member Function Documentation

◆ GetGravity()

virtual Math::Vector3 Engine3DRadSpace.Physics.ICharacterController.GetGravity ( ) const
pure virtual

Gets the gravity affecting the character.

Returns
The gravity vector.

Implemented in Engine3DRadSpace.Physics::NVPhysX::CharacterController.

◆ GetHeight()

virtual float Engine3DRadSpace.Physics.ICharacterController.GetHeight ( ) const
pure virtual

Gets the height of the character controller capsule collider.

Returns

Implemented in Engine3DRadSpace.Physics::NVPhysX::CharacterController.

◆ GetMaxSlopeAngle()

virtual float Engine3DRadSpace.Physics.ICharacterController.GetMaxSlopeAngle ( ) const
pure virtual

Gets the maximum slope angle the character can walk on.

Returns
The maximum slope angle in radians.

Implemented in Engine3DRadSpace.Physics::NVPhysX::CharacterController.

◆ GetRadius()

virtual float Engine3DRadSpace.Physics.ICharacterController.GetRadius ( ) const
pure virtual

Gets the radius of the character controller capsule collider.

Returns
The radius of the character controller capsule collider.

Implemented in Engine3DRadSpace.Physics::NVPhysX::CharacterController.

◆ IsGrounded() [1/2]

bool Engine3DRadSpace.Physics.ICharacterController.IsGrounded ( )
inline

◆ IsGrounded() [2/2]

Checks if the character is grounded.

Returns
True if the character is grounded, false otherwise.

Implemented in Engine3DRadSpace.Physics::NVPhysX::CharacterController.

◆ Jump() [1/2]

void Engine3DRadSpace.Physics.ICharacterController.Jump ( float height)
inline

◆ Jump() [2/2]

virtual void Engine3DRadSpace.Physics.ICharacterController.Jump ( float height)
pure virtual

Try to jump the character with the specified height.

Parameters
heightThe height to jump.

Implemented in Engine3DRadSpace.Physics::NVPhysX::CharacterController.

◆ Move() [1/2]

void Engine3DRadSpace.Physics.ICharacterController.Move ( Vector3 displacement)
inline

◆ Move() [2/2]

virtual void Engine3DRadSpace.Physics.ICharacterController.Move ( const Math::Vector3 & displacement)
pure virtual

Move the character with the specified displacement.

Parameters
displacementThe displacement vector to move the character by.

◆ operator=() [1/2]

ICharacterController & Engine3DRadSpace.Physics.ICharacterController.operator= ( const ICharacterController & )
protecteddelete

◆ operator=() [2/2]

ICharacterController & Engine3DRadSpace.Physics.ICharacterController.operator= ( ICharacterController && )
protecteddefaultnoexcept

◆ SetGravity()

virtual void Engine3DRadSpace.Physics.ICharacterController.SetGravity ( const Math::Vector3 & gravity)
pure virtual

Sets the gravity affecting the character.

Parameters
gravityThe gravity vector.

◆ SetHeight()

virtual void Engine3DRadSpace.Physics.ICharacterController.SetHeight ( float height)
pure virtual

Sets the height of the character controller capsule collider.

Parameters
height

Implemented in Engine3DRadSpace.Physics::NVPhysX::CharacterController.

◆ SetMaxSlopeAngle()

virtual void Engine3DRadSpace.Physics.ICharacterController.SetMaxSlopeAngle ( float angle)
pure virtual

Sets the maximum slope angle the character can walk on.

Parameters
angleThe maximum slope angle in radians.

Implemented in Engine3DRadSpace.Physics::NVPhysX::CharacterController.

◆ SetRadius()

virtual void Engine3DRadSpace.Physics.ICharacterController.SetRadius ( float radius)
pure virtual

Sets the radius of the character controller capsule collider.

Parameters
radiusThe radius of the character controller capsule collider.

Implemented in Engine3DRadSpace.Physics::NVPhysX::CharacterController.

Member Data Documentation

◆ _gravity

Math::Vector3 Engine3DRadSpace.Physics.ICharacterController._gravity
protected

◆ _height

float Engine3DRadSpace.Physics.ICharacterController._height
protected

◆ _maxSlopeAngle

float Engine3DRadSpace.Physics.ICharacterController._maxSlopeAngle = std::numbers::pi_v<float> / 4.0f
protected

◆ _radius

float Engine3DRadSpace.Physics.ICharacterController._radius
protected

Property Documentation

◆ Gravity

Vector3 Engine3DRadSpace.Physics.ICharacterController.Gravity
getset

◆ Height

float Engine3DRadSpace.Physics.ICharacterController.Height
getset

◆ MaxSlopeAngle

float Engine3DRadSpace.Physics.ICharacterController.MaxSlopeAngle
getset

◆ Radius

float Engine3DRadSpace.Physics.ICharacterController.Radius
getset

The documentation for this class was generated from the following files: