|
StevEngine
StevEngine is a customizable C++ game engine.
|
Base class for all collision shapes. More...
#include <physics/Colliders.hpp>
Public Member Functions | |
| Collider (JPH::Ref< JPH::Shape > shape, Utilities::Vector3 position=Utilities::Vector3(), Utilities::Quaternion rotation=Utilities::Quaternion(), Utilities::Vector3 scale=Utilities::Vector3(1, 1, 1)) | |
| Create new collider. | |
| Collider (Utilities::Stream &stream) | |
| Create collider from text serialized data. | |
| std::string | GetType () const |
| Get component type. | |
| Utilities::Stream | Export (Utilities::StreamType type) const |
| Serialize component to a stream. | |
| Utilities::Vector3 | GetScale () const |
| Get local scale. | |
| Utilities::Quaternion | GetRotation () const |
| Get local rotation. | |
| Utilities::Vector3 | GetPosition () const |
| Get local position. | |
| void | SetScale (Utilities::Vector3 scale) |
| Set local scale. | |
| void | SetRotation (Utilities::Quaternion rotation) |
| Set local rotation. | |
| void | SetPosition (Utilities::Vector3 position) |
| Set local position. | |
| void | SetTransform (Utilities::Vector3 position, Utilities::Quaternion rotation, Utilities::Vector3 scale) |
| Set full local transform. | |
| Utilities::Range3 | GetBounds () const |
| Get axis-aligned bounds. | |
| Utilities::Vector3 | GetCenterOfMass () const |
| Get center of mass. | |
| JPH::Ref< JPH::Shape > | GetShape () const |
| Get physics shape. | |
Public Member Functions inherited from StevEngine::Component | |
| Component () | |
| Create new component. | |
| virtual | ~Component () |
| Clean up component resources. | |
| GameObject & | GetParent () const |
| Get parent GameObject. | |
| Scene & | GetScene () const |
| Get containing Scene. | |
| virtual void | Update (double deltaTime) |
| Update component logic. | |
| virtual void | Draw (const Utilities::Matrix4 &transform) |
| Draw component visuals. | |
Protected Attributes | |
| Utilities::Vector3 | scale = Utilities::Vector3(1, 1, 1) |
| Local scale. | |
| Utilities::Vector3 | position = Utilities::Vector3() |
| Local position. | |
| Utilities::Quaternion | rotation = Utilities::Quaternion() |
| Local rotation. | |
| const JPH::Ref< JPH::Shape > | rawShape |
| Base physics shape. | |
| JPH::Ref< JPH::Shape > | shape |
| Transformed shape. | |
Protected Attributes inherited from StevEngine::Component | |
| std::vector< std::pair< Utilities::ID, std::string > > | handlers |
| Event handler registrations. | |
Friends | |
| class | StevEngine::GameObject |
Base class for all collision shapes.
Provides common functionality for physics collision shapes. Handles transform updates and shape creation/modification. Integrates with the Jolt physics engine for collision detection.
| StevEngine::Physics::Collider::Collider | ( | JPH::Ref< JPH::Shape > | shape, |
| Utilities::Vector3 | position = Utilities::Vector3(), | ||
| Utilities::Quaternion | rotation = Utilities::Quaternion(), | ||
| Utilities::Vector3 | scale = Utilities::Vector3(1,1,1) ) |
Create new collider.
| shape | Jolt physics shape |
| position | Local position offset |
| rotation | Local rotation offset |
| scale | Local scale modifier |
| StevEngine::Physics::Collider::Collider | ( | Utilities::Stream & | stream | ) |
Create collider from text serialized data.
| stream | Stream containing serialized component data |
|
virtual |
Serialize component to a stream.
| type | Type of stream to export to |
Reimplemented from StevEngine::Component.
|
inline |
Get axis-aligned bounds.
|
inline |
Get center of mass.
|
inline |
Get physics shape.
|
inlinevirtual |
| void StevEngine::Physics::Collider::SetPosition | ( | Utilities::Vector3 | position | ) |
Set local position.
| position | New position vector |
| void StevEngine::Physics::Collider::SetRotation | ( | Utilities::Quaternion | rotation | ) |
Set local rotation.
| rotation | New rotation quaternion |
| void StevEngine::Physics::Collider::SetScale | ( | Utilities::Vector3 | scale | ) |
Set local scale.
| scale | New scale vector |
| void StevEngine::Physics::Collider::SetTransform | ( | Utilities::Vector3 | position, |
| Utilities::Quaternion | rotation, | ||
| Utilities::Vector3 | scale ) |
Set full local transform.
| position | New position |
| rotation | New rotation |
| scale | New scale |