Rasterfarm-SDK
|
#include <physical.h>
Public Types | |
enum | BoundingType : uint { NONE = 0 , SPHERE , SEGMENT , SEGMENT_ARRAY , PLANE , DISK , AA_BOX , CAPSULE , BOX , POLYGON , CONTOUR , GEOMETRIC_HULL } |
Public Member Functions | |
GeometricAttribute () | |
GeometricAttribute (BoundingType boundingType, float mass, float elasticityCoeff, float frictionCoeff, float dragCoeff, bool transformable, float faceWidth=0.0f) | |
Public Member Functions inherited from Physical::SurfaceAttributes | |
SurfaceAttributes () | |
SurfaceAttributes (float elasticityCoeff, float frictionCoeff, float faceWidth=0.0f) | |
Public Attributes | |
BoundingType | boundingType |
float | mass |
float | dragCoeff |
bool | transformable |
Public Attributes inherited from Physical::SurfaceAttributes | |
float | elasticityCoeff |
float | frictionCoeff |
float | width |
Describes some basic physical attributes of a Geometric object.
enum Physical::GeometricAttribute::BoundingType : uint |
The appropriate primative to use to test for collisions and drag calculations by the Scene. This eliminates the need for the Engine3D to perform additional runtime tests. Note that if and an object's Geometry is manipulated or transformed, the default BoundingType may need to change (eg. a scaled-sphere is now a capsule). Note that Scene3D::Physical will use this determine the cross-sectional area for drag.
The types below are ordered by the complexity of the collision test.
Enumerator | |
---|---|
NONE | |
SPHERE | |
SEGMENT | |
SEGMENT_ARRAY | |
PLANE | |
DISK | |
AA_BOX | |
CAPSULE | |
BOX | |
POLYGON | |
CONTOUR | |
GEOMETRIC_HULL |
Physical::GeometricAttribute::GeometricAttribute | ( | ) |
Physical::GeometricAttribute::GeometricAttribute | ( | BoundingType | boundingType, |
float | mass, | ||
float | elasticityCoeff, | ||
float | frictionCoeff, | ||
float | dragCoeff, | ||
bool | transformable, | ||
float | faceWidth = 0.0f ) |
BoundingType Physical::GeometricAttribute::boundingType |
For very complex Geometries, the boundingType could be NONE but this would be rare and should be avoided.
float Physical::GeometricAttribute::dragCoeff |
A coefficient drag. Due to complexity, this is on a per-object basis and not per object-surface. Examples can be found here: https://en.wikipedia.org/wiki/Drag_coefficient
float Physical::GeometricAttribute::mass |
As in the physical-world, all objects have mass and this is key in determining how objects interact with each other. And with respect to gravity this value has no meaning(in theory).
bool Physical::GeometricAttribute::transformable |
A flag indicating if the object is modal or not.