21 #ifndef HX3D_PHYSICS_2D_COLLIDER 22 #define HX3D_PHYSICS_2D_COLLIDER 24 #include "hx3d/utils/ptr.hpp" 25 #include "hx3d/utils/object_map.hpp" 27 #include "hx3d/physics/2d/mass.hpp" 28 #include "hx3d/physics/2d/material.hpp" 30 #include <glm/glm.hpp> 129 void applyImpulse(
const glm::vec2& amount,
const glm::vec2& contact);
Physical material: friction & restitution.
Static: no forces or velocity.
void applyForce(const glm::vec2 &amount)
Apply a force.
void useDefinition(const Definition &def)
Apply a definition on the collider.
unsigned int category
Category.
bool fixedRotation
Fixed rotation ?
void setDensity(float density)
Set collider density.
Material material
Material.
glm::vec2 position
Position.
unsigned int category
Category.
glm::vec2 position
Position.
Kinematic: no forces but velocity.
Collider(const Shape shapeType, const Type colliderType=Type::Dynamic)
Create a collider.
float orientation
Orientation.
float unitCoef
Physical ratio.
Map of whatever you want. Useful for user data.
Dynamic: forces and velocity.
glm::vec2 gravityForce
Gravity force.
ObjectMap userData
User data.
float angularVelocity
Angular velocity.
glm::vec2 velocity
Velocity.
virtual void computeMass(float density)=0
Compute the collider mass.
void applyImpulse(const glm::vec2 &amount, const glm::vec2 &contact)
Apply an impulse.
glm::vec2 gravityScale
Gravity scale.
virtual void setOrientation(float angle)=0
Set the collider orientation.
std::shared_ptr< T > Ptr
Quick-typing shared ptr.
Material material
Material.
Ptr< Attractor > currentAttractor
Current attractor.