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

Base polymorphic type for dynamic physics objects that can move and interact with forces in the scene. More...

#include <IDynamicCollider.hpp>

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

Public Member Functions

void AttachShape (BoundingBox box)
void AttachShape (BoundingSphere sphere)
void UpdateMassAndInertia ()
void ApplyForce (Vector3 force)
void ApplyForce (Vector3 force, Vector3 center)
void ApplyTorque (Vector3 force)
void ApplyAcceleration (Vector3 acc)
void ApplyAngularAcceleration (Vector3 acc)
void SetKinematic (bool isKinematic)
void AddLinearVelocity (Vector3 v)
void AddAngularVelocity (Vector3 v)
 IDynamicCollider (IntPtr natPtr)
virtual float GetAngularDamping () const =0
 Gets the angular damping of the dynamic collider.
virtual void SetAngularDamping (float angularDamping)=0
 Sets the angular damping of the dynamic collider.
virtual Math::Vector3 GetLinearVelocity () const =0
 Gets the velocity of the dynamic collider.
virtual void SetLinearVelocity (const Math::Vector3 &linearVelocity)=0
 Sets the velocity of the dynamic collider.
virtual Math::Vector3 GetAngularVelocity () const =0
 Gets the angular velocity of the dynamic collider.
virtual void SetAngularVelocity (const Math::Vector3 &angularVelocity)=0
 Sets the angular velocity of the dynamic collider.
virtual Math::Vector3 GetMaxAngularVelocity () const =0
 Gets the maximum angular velocity of the dynamic collider.
virtual void SetMaxAngularVelocity (const Math::Vector3 &maxAngularVelocity)=0
 Sets the maximum angular velocity of the dynamic collider.
virtual void AttachShape (const Math::BoundingBox &box)=0
 Attaches an box shape to this dynamic collider.
virtual void AttachShape (const Math::BoundingSphere &sphere)=0
 Attaches an sphere shape to this dynamic collider.
virtual void UpdateMassAndInertia ()=0
 Updates the mass and inertia.
virtual void ApplyForce (const Math::Vector3 &force)=0
 Applies an linear force to this dynamic collider.
virtual void ApplyForce (const Math::Vector3 &force, const Math::Vector3 &center)=0
 Applies an force to this dynamic collider with a center that can cause angular motion.
virtual void ApplyTorque (const Math::Vector3 &force)=0
 Applies an torque to this dynamic collider.
virtual void ApplyAcceleration (const Math::Vector3 &acc)=0
 Applies acceleration to this dynamic collider.
virtual void ApplyAngularAcceleration (const Math::Vector3 &acc)=0
 Applies angular acceleration to this dynamic collider.
virtual void SetKinematic (bool isKinematic)=0
 Sets whether this dynamic collider is kinematic or not.
virtual void AddLinearVelocity (const Math::Vector3 &v)=0
 Adds linear velocity to this dynamic collider.
virtual void AddAngularVelocity (const Math::Vector3 &v)=0
 Adds angular velocity to this dynamic collider.
Public Member Functions inherited from Engine3DRadSpace.Physics.IStaticCollider
 IStaticCollider (IntPtr natPtr)
virtual float GetLinearDamping () const =0
 Gets the linear damping of the static collider.
virtual void SetLinearDamping (float linearDamping)=0
 Sets the linear damping of the static collider.
virtual float GetStaticFriction () const =0
 Gets the static friction of the static collider.
virtual void SetStaticFriction (float friction)=0
 Sets the static friction of the static collider.
virtual float GetDynamicFriction () const =0
 Gets the dynamic friction of the static collider.
virtual void SetDynamicFriction (float friction)=0
 Sets the dynamic friction of the static collider.
virtual float GetRestitution () const =0
 Gets the restitution of the static collider.
virtual void SetRestitution (float restitution)=0
 Sets the restitution of the static collider.
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

 IDynamicCollider (IPhysicsEngine *physics)
 IDynamicCollider (const IDynamicCollider &)=delete
IDynamicCollider & operator= (const IDynamicCollider &)=delete
 IDynamicCollider (IDynamicCollider &&) noexcept=default
IDynamicCollider & operator= (IDynamicCollider &&) noexcept=default
Protected Member Functions inherited from Engine3DRadSpace.Physics.IStaticCollider
 IStaticCollider (IntPtr natPtr, bool ownsHandle)
 IStaticCollider (IPhysicsEngine *physics)
 IStaticCollider (const IStaticCollider &)=delete
IStaticCollider & operator= (const IStaticCollider &)=delete
 IStaticCollider (IStaticCollider &&) noexcept=default
IStaticCollider & operator= (IStaticCollider &&) noexcept=default
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 _angularDamping = 0
Math::Vector3 _linearVelocity = Math::Vector3::Zero()
Math::Vector3 _angularVelocity = Math::Vector3::Zero()
Math::Vector3 _maxAngularVelocity = Math::Vector3(100.0f, 100.0f, 100.0f)
Protected Attributes inherited from Engine3DRadSpace.Physics.IStaticCollider
float _linearDamping = 0.01f
float _staticFriction = 0.5f
float _dynamicFriction = 0.5f
float _restitution = 0.1f
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 AngularDamping [get, set]
Vector3 LinearVelocity [get, set]
Vector3 AngularVelocity [get, set]
Vector3 MaxAngularVelocity [get, set]
Properties inherited from Engine3DRadSpace.Physics.IStaticCollider
float LinearDamping [get, set]
float StaticFriction [get, set]
float DynamicFriction [get, set]
float Restitution [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

Base polymorphic type for dynamic physics objects that can move and interact with forces in the scene.

Constructor & Destructor Documentation

◆ IDynamicCollider() [1/4]

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

◆ IDynamicCollider() [2/4]

◆ IDynamicCollider() [3/4]

◆ IDynamicCollider() [4/4]

Member Function Documentation

◆ AddAngularVelocity() [1/2]

void Engine3DRadSpace.Physics.IDynamicCollider.AddAngularVelocity ( Vector3 v)
inline

◆ AddAngularVelocity() [2/2]

Adds angular velocity to this dynamic collider.

Parameters
vangular velocity to add

◆ AddLinearVelocity() [1/2]

void Engine3DRadSpace.Physics.IDynamicCollider.AddLinearVelocity ( Vector3 v)
inline

◆ AddLinearVelocity() [2/2]

Adds linear velocity to this dynamic collider.

Parameters
vlinear velocity to add

◆ ApplyAcceleration() [1/2]

void Engine3DRadSpace.Physics.IDynamicCollider.ApplyAcceleration ( Vector3 acc)
inline

◆ ApplyAcceleration() [2/2]

Applies acceleration to this dynamic collider.

Parameters
accacceleration

◆ ApplyAngularAcceleration() [1/2]

void Engine3DRadSpace.Physics.IDynamicCollider.ApplyAngularAcceleration ( Vector3 acc)
inline

◆ ApplyAngularAcceleration() [2/2]

Applies angular acceleration to this dynamic collider.

Parameters
accangular acceleration

◆ ApplyForce() [1/4]

void Engine3DRadSpace.Physics.IDynamicCollider.ApplyForce ( Vector3 force)
inline

◆ ApplyForce() [2/4]

void Engine3DRadSpace.Physics.IDynamicCollider.ApplyForce ( Vector3 force,
Vector3 center )
inline

◆ ApplyForce() [3/4]

virtual void Engine3DRadSpace.Physics.IDynamicCollider.ApplyForce ( const Math::Vector3 & force)
pure virtual

Applies an linear force to this dynamic collider.

Parameters
forceforce

◆ ApplyForce() [4/4]

virtual void Engine3DRadSpace.Physics.IDynamicCollider.ApplyForce ( const Math::Vector3 & force,
const Math::Vector3 & center )
pure virtual

Applies an force to this dynamic collider with a center that can cause angular motion.

Parameters
forceforce
centercenter

◆ ApplyTorque() [1/2]

void Engine3DRadSpace.Physics.IDynamicCollider.ApplyTorque ( Vector3 force)
inline

◆ ApplyTorque() [2/2]

virtual void Engine3DRadSpace.Physics.IDynamicCollider.ApplyTorque ( const Math::Vector3 & force)
pure virtual

Applies an torque to this dynamic collider.

Parameters
forceforce

◆ AttachShape() [1/4]

void Engine3DRadSpace.Physics.IDynamicCollider.AttachShape ( BoundingBox box)
inline

◆ AttachShape() [2/4]

void Engine3DRadSpace.Physics.IDynamicCollider.AttachShape ( BoundingSphere sphere)
inline

◆ AttachShape() [3/4]

Attaches an box shape to this dynamic collider.

Parameters
boxboundingbox

◆ AttachShape() [4/4]

Attaches an sphere shape to this dynamic collider.

Parameters
sphereboundingsphere

◆ GetAngularDamping()

virtual float Engine3DRadSpace.Physics.IDynamicCollider.GetAngularDamping ( ) const
pure virtual

Gets the angular damping of the dynamic collider.

Returns
The angular damping value.

Implemented in Engine3DRadSpace.Physics::NVPhysX::DynamicCollider.

◆ GetAngularVelocity()

virtual Math::Vector3 Engine3DRadSpace.Physics.IDynamicCollider.GetAngularVelocity ( ) const
pure virtual

Gets the angular velocity of the dynamic collider.

Returns
The angular velocity vector.

Implemented in Engine3DRadSpace.Physics::NVPhysX::DynamicCollider.

◆ GetLinearVelocity()

virtual Math::Vector3 Engine3DRadSpace.Physics.IDynamicCollider.GetLinearVelocity ( ) const
pure virtual

Gets the velocity of the dynamic collider.

Returns
linear velocity

Implemented in Engine3DRadSpace.Physics::NVPhysX::DynamicCollider.

◆ GetMaxAngularVelocity()

virtual Math::Vector3 Engine3DRadSpace.Physics.IDynamicCollider.GetMaxAngularVelocity ( ) const
pure virtual

Gets the maximum angular velocity of the dynamic collider.

Returns
The maximum angular velocity vector.

Implemented in Engine3DRadSpace.Physics::NVPhysX::DynamicCollider.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ SetAngularDamping()

virtual void Engine3DRadSpace.Physics.IDynamicCollider.SetAngularDamping ( float angularDamping)
pure virtual

Sets the angular damping of the dynamic collider.

Parameters
angularDampingThe angular damping value.

Implemented in Engine3DRadSpace.Physics::NVPhysX::DynamicCollider.

◆ SetAngularVelocity()

virtual void Engine3DRadSpace.Physics.IDynamicCollider.SetAngularVelocity ( const Math::Vector3 & angularVelocity)
pure virtual

Sets the angular velocity of the dynamic collider.

Parameters
angularVelocityThe angular velocity vector.

◆ SetKinematic() [1/2]

void Engine3DRadSpace.Physics.IDynamicCollider.SetKinematic ( bool isKinematic)
inline

◆ SetKinematic() [2/2]

virtual void Engine3DRadSpace.Physics.IDynamicCollider.SetKinematic ( bool isKinematic)
pure virtual

Sets whether this dynamic collider is kinematic or not.

Kinematic colliders are not affected by forces and can be moved manually, while non-kinematic colliders are affected by physics forces and collisions.

Parameters
isKinematictrue to make the collider kinematic, false otherwise

Implemented in Engine3DRadSpace.Physics::NVPhysX::DynamicCollider.

◆ SetLinearVelocity()

virtual void Engine3DRadSpace.Physics.IDynamicCollider.SetLinearVelocity ( const Math::Vector3 & linearVelocity)
pure virtual

Sets the velocity of the dynamic collider.

Parameters
linearVelocityThe linear velocity vector.

◆ SetMaxAngularVelocity()

virtual void Engine3DRadSpace.Physics.IDynamicCollider.SetMaxAngularVelocity ( const Math::Vector3 & maxAngularVelocity)
pure virtual

Sets the maximum angular velocity of the dynamic collider.

Returns
The maximum angular velocity vector.

◆ UpdateMassAndInertia() [1/2]

void Engine3DRadSpace.Physics.IDynamicCollider.UpdateMassAndInertia ( )
inline

◆ UpdateMassAndInertia() [2/2]

Updates the mass and inertia.

Implemented in Engine3DRadSpace.Physics::NVPhysX::DynamicCollider.

Member Data Documentation

◆ _angularDamping

float Engine3DRadSpace.Physics.IDynamicCollider._angularDamping = 0
protected

◆ _angularVelocity

Math::Vector3 Engine3DRadSpace.Physics.IDynamicCollider._angularVelocity = Math::Vector3::Zero()
protected

◆ _linearVelocity

Math::Vector3 Engine3DRadSpace.Physics.IDynamicCollider._linearVelocity = Math::Vector3::Zero()
protected

◆ _maxAngularVelocity

Math::Vector3 Engine3DRadSpace.Physics.IDynamicCollider._maxAngularVelocity = Math::Vector3(100.0f, 100.0f, 100.0f)
protected

Property Documentation

◆ AngularDamping

float Engine3DRadSpace.Physics.IDynamicCollider.AngularDamping
getset

◆ AngularVelocity

Vector3 Engine3DRadSpace.Physics.IDynamicCollider.AngularVelocity
getset

◆ LinearVelocity

Vector3 Engine3DRadSpace.Physics.IDynamicCollider.LinearVelocity
getset

◆ MaxAngularVelocity

Vector3 Engine3DRadSpace.Physics.IDynamicCollider.MaxAngularVelocity
getset

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