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

Physics engine interface. More...

#include <IPhysicsEngine.hpp>

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

Public Member Functions

void Simulate (float dt)
IntPtr GetScene ()
IStaticCollider CreateStaticCollider (Model3D model, Vector3 position, Quaternion rotation, Vector3 scale)
IDynamicCollider CreateDynamicCollider ()
ICharacterController CreateCharacterController (float radius, float height, Vector3 position)
IJoint CreateJoint (JointType type)
 IPhysicsEngine (IntPtr natPtr)
virtual void Simulate (float dt)=0
 Simulates the world with a step in dt seconds.
virtual void * GetScene () const noexcept=0
 Gets an handle to the scene.
virtual std::unique_ptr< IStaticCollider > CreateStaticCollider (Graphics::Model3D *model, const Math::Vector3 &position=Math::Vector3::Zero(), const Math::Quaternion &rotation=Math::Quaternion(), const Math::Vector3 &scale=Math::Vector3::One())=0
 Creates an static collider for the given model with the specified position, rotation, and scale.
virtual std::unique_ptr< IDynamicCollider > CreateDynamicCollider ()=0
 Creates a dynamic collider.
virtual std::unique_ptr< ICharacterController > CreateCharacterController (float radius, float height, const Math::Vector3 &position=Math::Vector3::Zero())=0
 Creates a character controller.
virtual std::unique_ptr< IJoint > CreateJoint (JointType type)=0
 Creates a joint of the specified type.
virtual double dt () const noexcept=0
 Returns the time step.
virtual void SetGravity (const Math::Vector3 &gravity)=0
 Sets the simulation gravity.
virtual Math::Vector3 GetGravity () const =0
 Gets the simulation gravity.
 ~IPhysicsEngine () override=default
Public Member Functions inherited from Engine3DRadSpace.NatPtrWrapper
virtual void Dispose ()
Public Member Functions inherited from Engine3DRadSpace.IService
IGame * GetOwner () const noexcept
 Gets the owner of this instance.
virtual ~IService ()=default

Properties

double DT [get]
Vector3 Gravity [get, set]
Properties inherited from Engine3DRadSpace.InstIService
IGame Owner [get]
Properties inherited from Engine3DRadSpace.NatPtrWrapper
IntPtr Handle [get]
Properties inherited from Engine3DRadSpace.IService
IGame Owner [get]

Additional Inherited Members

Protected Member Functions inherited from Engine3DRadSpace.InstIService
 InstIService (IntPtr handle)
 InstIService (IntPtr handle, bool ownsHandle)
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 Member Functions inherited from Engine3DRadSpace.IService
 IService ()
 IService (IGame *owner)
 IService (const IService &)=delete
IService & operator= (const IService &)=delete
 IService (IService &&) noexcept=default
IService & operator= (IService &&) noexcept=default
Protected Attributes inherited from Engine3DRadSpace.NatPtrWrapper
IntPtr _handle
bool _disposed
Protected Attributes inherited from Engine3DRadSpace.IService
IGame * _owner = nullptr

Detailed Description

Physics engine interface.

Constructor & Destructor Documentation

◆ IPhysicsEngine()

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

◆ ~IPhysicsEngine()

Engine3DRadSpace.Physics.IPhysicsEngine.~IPhysicsEngine ( )
overridedefault

Member Function Documentation

◆ CreateCharacterController() [1/2]

ICharacterController Engine3DRadSpace.Physics.IPhysicsEngine.CreateCharacterController ( float radius,
float height,
Vector3 position )
inline

◆ CreateCharacterController() [2/2]

virtual std::unique_ptr< ICharacterController > Engine3DRadSpace.Physics.IPhysicsEngine.CreateCharacterController ( float radius,
float height,
const Math::Vector3 & position = Math::Vector3::Zero() )
pure virtual

Creates a character controller.

Parameters
radiusThe radius of the character controller.
heightThe height of the character controller.
positionThe position of the character controller.
Returns
A unique pointer to the created character controller.

◆ CreateDynamicCollider() [1/2]

IDynamicCollider Engine3DRadSpace.Physics.IPhysicsEngine.CreateDynamicCollider ( )
inline

◆ CreateDynamicCollider() [2/2]

Creates a dynamic collider.

Returns
A unique pointer to the created dynamic collider.

Implemented in Engine3DRadSpace.Physics::NVPhysX::PhysicsEngine.

◆ CreateJoint() [1/2]

IJoint Engine3DRadSpace.Physics.IPhysicsEngine.CreateJoint ( JointType type)
inline

◆ CreateJoint() [2/2]

virtual std::unique_ptr< IJoint > Engine3DRadSpace.Physics.IPhysicsEngine.CreateJoint ( JointType type)
pure virtual

Creates a joint of the specified type.

Parameters
typeThe type of joint to create.
Returns
A unique pointer to the created joint.

Implemented in Engine3DRadSpace.Physics::NVPhysX::PhysicsEngine.

◆ CreateStaticCollider() [1/2]

IStaticCollider Engine3DRadSpace.Physics.IPhysicsEngine.CreateStaticCollider ( Model3D model,
Vector3 position,
Quaternion rotation,
Vector3 scale )
inline

◆ CreateStaticCollider() [2/2]

virtual std::unique_ptr< IStaticCollider > Engine3DRadSpace.Physics.IPhysicsEngine.CreateStaticCollider ( Graphics::Model3D * model,
const Math::Vector3 & position = Math::Vector3::Zero(),
const Math::Quaternion & rotation = Math::Quaternion(),
const Math::Vector3 & scale = Math::Vector3::One() )
pure virtual

Creates an static collider for the given model with the specified position, rotation, and scale.

Parameters
modelThe 3D model to create the static collider for.
positionThe position of the static collider.
rotationThe rotation of the static collider.
scaleThe scale of the static collider.
Returns
A unique pointer to the created static collider.

◆ dt()

virtual double Engine3DRadSpace.Physics.IPhysicsEngine.dt ( ) const
pure virtualnoexcept

Returns the time step.

Returns
The time step in seconds.

Implemented in Engine3DRadSpace.Physics::NVPhysX::PhysicsEngine.

◆ GetGravity()

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

Gets the simulation gravity.

Returns
gravity in m/s^2

Implemented in Engine3DRadSpace.Physics::NVPhysX::PhysicsEngine.

◆ GetScene() [1/2]

IntPtr Engine3DRadSpace.Physics.IPhysicsEngine.GetScene ( )
inline

◆ GetScene() [2/2]

virtual void * Engine3DRadSpace.Physics.IPhysicsEngine.GetScene ( ) const
pure virtualnoexcept

Gets an handle to the scene.

Returns
scene handle

Implemented in Engine3DRadSpace.Physics::NVPhysX::PhysicsEngine.

◆ SetGravity()

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

Sets the simulation gravity.

Parameters
gravitygravity in m/s^2

◆ Simulate() [1/2]

void Engine3DRadSpace.Physics.IPhysicsEngine.Simulate ( float dt)
inline

◆ Simulate() [2/2]

Simulates the world with a step in dt seconds.

Parameters
dtstep duration in seconds

Implemented in Engine3DRadSpace.Physics::NVPhysX::PhysicsEngine.

Property Documentation

◆ DT

double Engine3DRadSpace.Physics.IPhysicsEngine.DT
get

◆ Gravity

Vector3 Engine3DRadSpace.Physics.IPhysicsEngine.Gravity
getset

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