Classes¶
Physics/Collision
Brief descriptions¶
Structures |
|
Provides generic interface for collision shape access. |
|
Provides generic interface for sphere collision shape access. |
|
Provides generic interface for box collision shape access. |
|
Provides generic interface for capsule collision shape access. |
|
Provides generic interface for cylinder collision shape access. |
|
Provides a generic interface for convex hull collision shape access. |
|
Provides a generic interface for mesh collision shape access. |
|
Provides interface for accessing information about physical bodies contacts. |
|
Classes |
|
Provides interface for collider shape creation. |
Detailed information¶
physics::ICollisionShape¶
engine/core/modules/physics/include/nau/physics/physics_collider.h
-
struct ICollisionShape : public virtual IRttiObject¶
Provides generic interface for collision shape access.
Subclassed by nau::physics::IBoxCollision, nau::physics::ICapsuleCollision, nau::physics::IConvexHullCollision, nau::physics::ICylinderCollision, nau::physics::IMeshCollision, nau::physics::ISphereCollision
Public Types
-
using Ptr = eastl::unique_ptr<ICollisionShape>¶
Pointer type used to reference a collision shape.
Public Functions
- virtual IRttiObject void setShapeTransform (math::Transform localTransform)=0
-
virtual math::Transform getShapeTransform() const = 0¶
-
using Ptr = eastl::unique_ptr<ICollisionShape>¶
physics::ISphereCollision¶
engine/core/modules/physics/include/nau/physics/physics_collider.h
-
struct ISphereCollision : public virtual nau::physics::ICollisionShape¶
Provides generic interface for sphere collision shape access.
physics::IBoxCollision¶
engine/core/modules/physics/include/nau/physics/physics_collider.h
-
struct IBoxCollision : public virtual nau::physics::ICollisionShape¶
Provides generic interface for box collision shape access.
physics::ICapsuleCollision¶
engine/core/modules/physics/include/nau/physics/physics_collider.h
-
struct ICapsuleCollision : public virtual nau::physics::ICollisionShape¶
Provides generic interface for capsule collision shape access.
-
struct ConstructionData¶
Encapsulates capsule geometry data.
-
struct ConstructionData¶
physics::ICylinderCollision¶
engine/core/modules/physics/include/nau/physics/physics_collider.h
-
struct ICylinderCollision : public virtual nau::physics::ICollisionShape¶
Provides generic interface for cylinder collision shape access.
-
struct ConstructionData¶
Encapsulates cylinder geometry data.
-
struct ConstructionData¶
physics::IConvexHullCollision¶
engine/core/modules/physics/include/nau/physics/physics_collider.h
-
struct IConvexHullCollision : public virtual nau::physics::ICollisionShape¶
Provides a generic interface for convex hull collision shape access.
physics::IMeshCollision¶
engine/core/modules/physics/include/nau/physics/physics_collider.h
-
struct IMeshCollision : public virtual nau::physics::ICollisionShape¶
Provides a generic interface for mesh collision shape access.
-
struct ConstructionData¶
Encapsulates mesh geometry data.
Public Members
-
eastl::vector<nau::physics::IPhysicsMaterial*> materials¶
List of materials which triangles in the mesh can reference via nau::physics::IMeshCollision::Triangle::materialIndex.
-
eastl::vector<nau::physics::IPhysicsMaterial*> materials¶
-
struct ConstructionData¶
physics::IPhysicsContactListener¶
engine/core/modules/physics/include/nau/physics/physics_contact_listener.h
-
struct IPhysicsContactListener : public virtual IRefCounted¶
Provides interface for accessing information about physical bodies contacts.
Public Types
-
using Ptr = Ptr<IPhysicsContactListener>¶
Pointer type used to reference a IPhysicsContactListener objects.
Public Functions
-
virtual void onContactAdded(const ContactManifold &data1, const ContactManifold &data2, const eastl::vector<math::vec3> &collisionWorldPoints) = 0¶
Called when a contact between two bodies begins.
- Parameters:
data1, data2 – [in] Keep information about the contacting bodies.
collisionWorldPoints – [in] Array of contact points (in world coordinates).
-
virtual void onContactContinued(const ContactManifold &data1, const ContactManifold &data2, const eastl::vector<math::vec3> &collisionWorldPoints) = 0¶
Called each frame while two bodies continue contacting.
- Parameters:
data1, data2 – [in] Keep information about the contacting bodies.
collisionWorldPoints – [in] Array of contact points (in world coordinates).
-
virtual void onContactRemovedCompletely(const ContactManifold &data1, const ContactManifold &data2) = 0¶
Called when a contact between two bodies ceases.
- Parameters:
data1, data2 – [in] Keep information about the bodies that stopped contacting.
-
struct ContactManifold¶
Encapsulates the data that is passed to the listener from each of the contacting bodies.
Public Members
-
physics::RigidBodyComponent &rigidBody¶
Component which the contacting body is attached to.
-
nau::physics::IPhysicsMaterial::Ptr material¶
Contacting body material.
Note
material is
NULL
when a ContactManifold instance is passed to onContactRemovedCompletely.
-
physics::RigidBodyComponent &rigidBody¶
-
using Ptr = Ptr<IPhysicsContactListener>¶
physics::ColliderBase¶
engine/core/modules/physics/include/nau/physics/components/colliders.h
-
struct ColliderBase¶
Subclassed by nau::physics::BoxCollider, nau::physics::CapsuleCollider, nau::physics::CylinderCollider, nau::physics::SphereCollider
physics::SphereCollider¶
engine/core/modules/physics/include/nau/physics/components/colliders.h
-
struct SphereCollider : public nau::physics::ColliderBase¶
Public Members
- radius float radius = 1.0f
physics::BoxCollider¶
engine/core/modules/physics/include/nau/physics/components/colliders.h
-
struct BoxCollider : public nau::physics::ColliderBase¶
Public Members
- extent math::vec3 extent = math::vec3::one()
physics::CapsuleCollider¶
engine/core/modules/physics/include/nau/physics/components/colliders.h
-
struct CapsuleCollider : public nau::physics::ColliderBase¶
physics::CylinderCollider¶
engine/core/modules/physics/include/nau/physics/components/colliders.h
-
struct CylinderCollider : public nau::physics::ColliderBase¶
physics::CollisionDescription¶
engine/core/modules/physics/include/nau/physics/components/colliders.h
-
struct CollisionDescription¶
Public Functions
-
inline decltype(auto) addBox(math::vec3 extent)¶
-
inline decltype(auto) addCapsule(float height, float radius)¶
-
inline decltype(auto) addCylinder(float height, float radius)¶
Public Members
-
eastl::vector<SphereCollider> spheres¶
-
eastl::vector<BoxCollider> boxes¶
-
eastl::vector<CapsuleCollider> capsules¶
-
eastl::vector<CylinderCollider> cylinders¶
- spheres
- boxes
- capsules
- cylinders
-
inline decltype(auto) addBox(math::vec3 extent)¶
physics::ICollisionShapesFactory¶
engine/core/modules/physics/include/nau/physics/physics_collision_shapes_factory.h
-
class ICollisionShapesFactory : public virtual IRefCounted¶
Provides interface for collider shape creation.
Private Functions
- virtual IRefCounted ICollisionShape::Ptr createGenericCollisionShape (const rtti::TypeInfo &colliderType, const RuntimeValue::Ptr &constructionData=nullptr, nau::physics::IPhysicsMaterial *material=nullptr) const =0
Creates a collider shape.
- Parameters:
colliderType – [in] Contains information about the actual collider type to create.
constructionData – [in] Generic container for shape geometry.
material – [in] Material to apply to the collider.
- Returns:
A pointer to the created shape.
-
inline eastl::unique_ptr<ISphereCollision> createSphereCollision(TFloat radius, nau::physics::IPhysicsMaterial *material = nullptr) const¶
Creates a sphere collider shape.
- Parameters:
radius – [in] Sphere radius.
material – [in] Material to apply to the collider.
- Returns:
A pointer to the created sphere shape.
-
inline eastl::unique_ptr<IBoxCollision> createBoxCollision(math::vec3 extent, nau::physics::IPhysicsMaterial *material = nullptr) const¶
Creates a box collider shape.
- Parameters:
extent – [in] Box half-size.
material – [in] Material to apply to the collider.
- Returns:
A pointer to the created box shape.
-
inline eastl::unique_ptr<ICapsuleCollision> createCapsuleCollision(const ICapsuleCollision::ConstructionData &constructionData, nau::physics::IPhysicsMaterial *material = nullptr) const¶
Creates a capsule collider shape.
- Parameters:
constructionData – [in] Capsule geometry.
material – [in] Material to apply to the collider.
- Returns:
A pointer to the created capsule shape.
-
inline eastl::unique_ptr<ICylinderCollision> createCylinderCollision(const ICylinderCollision::ConstructionData &constructionData, nau::physics::IPhysicsMaterial *material = nullptr) const¶
Creates a cylinder collider shape.
- Parameters:
constructionData – [in] Cylinder geometry.
material – [in] Material to apply to the collider.
- Returns:
A pointer to the created cylinder shape.
-
virtual IConvexHullCollision::Ptr createConvexHullCollision(const IConvexHullCollision::ConstructionData &constructionData, nau::physics::IPhysicsMaterial *material = nullptr) const = 0¶
Creates a convex hull collider shape.
- Parameters:
constructionData – [in] Convex hull geometry.
material – [in] Material to apply to the collider.
- Returns:
A pointer to the created convex hull shape.
-
virtual IMeshCollision::Ptr createMeshCollision(const IMeshCollision::ConstructionData &constructionData) const = 0¶
Creates a mesh collider shape.
- Parameters:
constructionData – [in] Mesh geometry.
- Returns:
A pointer to the created mesh shape.
-
virtual ICollisionShape::Ptr createMeshCollisionFromAsset(nau::Ptr<physics::TriMeshAssetView> asset) const = 0¶
-
virtual ICollisionShape::Ptr createConvexHullCollisionFromAsset(nau::Ptr<physics::ConvexHullAssetView> asset) const = 0¶
-
template<std::derived_from<ICollisionShape> CollisionShapeType, typename Argument>
eastl::unique_ptr<CollisionShapeType> createGenericCollisionShapeTyped(const Argument &constructionData, nau::physics::IPhysicsMaterial *material = nullptr) const¶ Creates a collider shape.
- Template Parameters:
CollisionShapeType – Output shape type. In has to be a subclass of ICollisionShape.
Argument – Type of shape geometry data.
- Parameters:
constructionData – [in] Generic container for shape geometry.
material – [in] A pointer to the material to apply to the collider.
- Returns:
A pointer to the created shape.