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

Base polymorphic type for physics objects that interact with the scene. More...

#include <ICollider.hpp>

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

Public Member Functions

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

 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

IPhysicsEngine * _physics
float _mass = 1.0f
Math::Vector3 _position
Math::Quaternion _rotation
Protected Attributes inherited from Engine3DRadSpace.NatPtrWrapper
IntPtr _handle
bool _disposed

Properties

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

Base polymorphic type for physics objects that interact with the scene.

Constructor & Destructor Documentation

◆ ICollider() [1/5]

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

◆ ICollider() [2/5]

Engine3DRadSpace.Physics.ICollider.ICollider ( IntPtr natPtr,
bool ownsHandle )
inlineprotected

◆ ICollider() [3/5]

ICollider::ICollider ( IPhysicsEngine * physics)
protected

◆ ICollider() [4/5]

◆ ICollider() [5/5]

◆ ~ICollider()

virtual Engine3DRadSpace.Physics.ICollider.~ICollider ( )
virtualdefault

Member Function Documentation

◆ ApplyAcceleration()

bool Engine3DRadSpace.Physics.ICollider.ApplyAcceleration ( Vector3 acc)
inline

◆ ApplyAngularAcceleration()

bool Engine3DRadSpace.Physics.ICollider.ApplyAngularAcceleration ( Vector3 acc)
inline

◆ ApplyForce() [1/2]

bool Engine3DRadSpace.Physics.ICollider.ApplyForce ( Vector3 force)
inline

◆ ApplyForce() [2/2]

bool Engine3DRadSpace.Physics.ICollider.ApplyForce ( Vector3 force,
Vector3 center )
inline

◆ ApplyTorque()

bool Engine3DRadSpace.Physics.ICollider.ApplyTorque ( Vector3 force)
inline

◆ GetMass()

virtual float Engine3DRadSpace.Physics.ICollider.GetMass ( ) const
pure virtual

◆ GetPhysics() [1/2]

IPhysicsEngine Engine3DRadSpace.Physics.ICollider.GetPhysics ( )
inline

◆ GetPhysics() [2/2]

IPhysicsEngine * ICollider::GetPhysics ( ) const
noexcept

Gets the physics engine that this collider is associated with.

Returns

◆ GetPosition()

virtual Math::Vector3 Engine3DRadSpace.Physics.ICollider.GetPosition ( ) const
pure virtual

◆ GetRotation()

virtual Math::Quaternion Engine3DRadSpace.Physics.ICollider.GetRotation ( ) const
pure virtual

◆ Intersects() [1/2]

float? Engine3DRadSpace.Physics.ICollider.Intersects ( Ray r)
inline

◆ Intersects() [2/2]

virtual std::optional< float > Engine3DRadSpace.Physics.ICollider.Intersects ( const Math::Ray & r)
pure virtual

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.

Parameters
rThe ray to test for intersection.
Returns
The distance from the ray origin to the intersection point, or std::nullopt if there is no intersection.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ SetMass()

virtual void Engine3DRadSpace.Physics.ICollider.SetMass ( float mass)
pure virtual

◆ SetPosition()

virtual void Engine3DRadSpace.Physics.ICollider.SetPosition ( const Math::Vector3 & position)
pure virtual

Sets the position of this collider.

Parameters
positionThe position vector.

◆ SetRotation()

virtual void Engine3DRadSpace.Physics.ICollider.SetRotation ( const Math::Quaternion & rotation)
pure virtual

Sets the rotation of this collider.

Parameters
rotationThe rotation quaternion.

◆ UpdateTransform() [1/4]

void Engine3DRadSpace.Physics.ICollider.UpdateTransform ( )
inline

◆ UpdateTransform() [2/4]

void Engine3DRadSpace.Physics.ICollider.UpdateTransform ( Vector3 position,
Quaternion rotation )
inline

◆ UpdateTransform() [3/4]

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.

Implemented in Engine3DRadSpace.Physics::NVPhysX::CharacterController, Engine3DRadSpace.Physics::NVPhysX::DynamicCollider, and Engine3DRadSpace.Physics::NVPhysX::StaticMeshCollider.

◆ UpdateTransform() [4/4]

virtual void Engine3DRadSpace.Physics.ICollider.UpdateTransform ( const Math::Vector3 & position,
const Math::Quaternion & rotation )
pure virtual

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.

Parameters
positionThe position vector.
rotationThe rotation quaternion.

Member Data Documentation

◆ _mass

float Engine3DRadSpace.Physics.ICollider._mass = 1.0f
protected

◆ _physics

IPhysicsEngine* Engine3DRadSpace.Physics.ICollider._physics
protected

◆ _position

Math::Vector3 Engine3DRadSpace.Physics.ICollider._position
protected

◆ _rotation

Math::Quaternion Engine3DRadSpace.Physics.ICollider._rotation
protected

Property Documentation

◆ AngularDamping

float Engine3DRadSpace.Physics.ICollider.AngularDamping
getset

◆ AngularVelocity

Vector3 Engine3DRadSpace.Physics.ICollider.AngularVelocity
getset

◆ DynamicFriction

float Engine3DRadSpace.Physics.ICollider.DynamicFriction
getset

◆ LinearDamping

float Engine3DRadSpace.Physics.ICollider.LinearDamping
getset

◆ LinearVelocity

Vector3 Engine3DRadSpace.Physics.ICollider.LinearVelocity
getset

◆ Mass

float Engine3DRadSpace.Physics.ICollider.Mass
getset

◆ MaxAngularVelocity

Vector3 Engine3DRadSpace.Physics.ICollider.MaxAngularVelocity
getset

◆ Position

Vector3 Engine3DRadSpace.Physics.ICollider.Position
getset

◆ Restitution

float Engine3DRadSpace.Physics.ICollider.Restitution
getset

◆ Rotation

Quaternion Engine3DRadSpace.Physics.ICollider.Rotation
getset

◆ StaticFriction

float Engine3DRadSpace.Physics.ICollider.StaticFriction
getset

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