Classes

PhysicsJolt/Materials

Brief descriptions

Classes

nau::physics::jolt::JoltPhysicsMaterial

Jolt material class wrapper.

nau::physics::jolt::NauJoltPhysicsMaterialImpl

Implements nau::physics::IPhysicsMaterial interface utilizing Jolt physics engine.

Detailed information

physics::jolt::JoltPhysicsMaterial

engine/core/modules/physicsJolt/include/nau/physics/jolt/jolt_physics_material.h

class JoltPhysicsMaterial : public JPH::PhysicsMaterial

Jolt material class wrapper.

Public Functions

const char *GetDebugName() const override

Retrieves the name of the material.

Returns:

Material name.

const nau::physics::IPhysicsMaterial::Ptr &engineMaterial() const

Retrieves native engine material this instance is associated with.

Returns:

A pointer to engine native material instance.

void setEngineMaterial(nau::physics::IPhysicsMaterial::Ptr engineMaterial)

Associates this instance to a native engine material.

Parameters:

engineMaterial[in] A pointer to the engine material instance.

Private Members

nau::physics::IPhysicsMaterial::Ptr m_engineMaterial

Native engine material this instance is associated with.


physics::jolt::NauJoltPhysicsMaterialImpl

engine/core/modules/physicsJolt/include/nau/physics/jolt/jolt_physics_material.h

class NauJoltPhysicsMaterialImpl : public nau::physics::IPhysicsMaterial

Implements nau::physics::IPhysicsMaterial interface utilizing Jolt physics engine.

Private Functions

NauJoltPhysicsMaterialImpl(eastl::string_view name, eastl::optional<TFloat> friction = eastl::nullopt, eastl::optional<TFloat> restitution = eastl::nullopt)
virtual eastl::string_view getName() const override

Retrieves the name of the material.

Returns:

Material name.

virtual eastl::optional<TFloat> getFriction() const override

Retrieves the friction value.

See m_friction for more information.

Returns:

Friction value. Empty value might be returned in case this material doesn’t override the body default friction.

virtual eastl::optional<TFloat> getRestitution() const override

Retrieves the restitution value.

See m_restitution for more information.

Returns:

Restitution value. Empty value might be returned in case this material doesn’t override the body default restitution.

JoltPhysicsMaterial *joltMaterial() const

Retrieves the Jolt material ths object is associated with.

Returns:

A pointer to the Jolt material instance.

Private Members

eastl::string m_name

Name of the material.

eastl::optional<TFloat> m_friction

Degree of how the body resists being dragged.

It has to be between 0.0 (no friction) and 1.0 (the body will stick to the surface and stay immobile).

eastl::optional<TFloat> m_restitution

Degree of body tougheness on collision.

It has to be between 0.0 (completely inelastic collision response) and 1.0 (completely elastic collision response).

JoltPhysicsMaterial *m_joltMaterial = nullptr

A pointer to the Jolt material ths object is associated with.