|
@@ -11,38 +11,46 @@ namespace bs
|
|
|
* @{
|
|
* @{
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
- /** Physics material that controls how objects react when they collide. */
|
|
|
|
|
- class BS_CORE_EXPORT PhysicsMaterial : public Resource
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Material that controls how two physical objects interact with each other. Materials of both objects are used during
|
|
|
|
|
+ * their interaction and their combined values are used.
|
|
|
|
|
+ */
|
|
|
|
|
+ class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:Physics) PhysicsMaterial : public Resource
|
|
|
{
|
|
{
|
|
|
public:
|
|
public:
|
|
|
virtual ~PhysicsMaterial() { }
|
|
virtual ~PhysicsMaterial() { }
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Sets static friction of the material. Controls friction when two in-contact objects are not moving lateral to
|
|
|
|
|
- * each other (for example how difficult is to get an object moving from a static state while it is in contact
|
|
|
|
|
- * other object(s)).
|
|
|
|
|
|
|
+ * Controls friction when two in-contact objects are not moving lateral to each other (for example how difficult
|
|
|
|
|
+ * it is to get an object moving from a static state while it is in contact with other object(s)).
|
|
|
*/
|
|
*/
|
|
|
|
|
+ BS_SCRIPT_EXPORT(n:StaticFriction,pr:setter)
|
|
|
virtual void setStaticFriction(float value) = 0;
|
|
virtual void setStaticFriction(float value) = 0;
|
|
|
|
|
|
|
|
- /** Gets static friction of the material. */
|
|
|
|
|
|
|
+ /** @copydoc setStaticFriction() */
|
|
|
|
|
+ BS_SCRIPT_EXPORT(n:StaticFriction,pr:getter)
|
|
|
virtual float getStaticFriction() const = 0;
|
|
virtual float getStaticFriction() const = 0;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Sets dynamic friction of the material. Controls friction when two in-contact objects are moving lateral to each
|
|
|
|
|
- * other (for example how quickly does an object slow down when sliding along another object).
|
|
|
|
|
|
|
+ * Controls friction when two in-contact objects are moving lateral to each other (for example how quickly does an
|
|
|
|
|
+ * object slow down when sliding along another object).
|
|
|
*/
|
|
*/
|
|
|
|
|
+ BS_SCRIPT_EXPORT(n:DynamicFriction,pr:setter)
|
|
|
virtual void setDynamicFriction(float value) = 0;
|
|
virtual void setDynamicFriction(float value) = 0;
|
|
|
|
|
|
|
|
- /** Gets dynamic friction of the material .*/
|
|
|
|
|
|
|
+ /** @copydoc setDynamicFriction() */
|
|
|
|
|
+ BS_SCRIPT_EXPORT(n:DynamicFriction,pr:getter)
|
|
|
virtual float getDynamicFriction() const = 0;
|
|
virtual float getDynamicFriction() const = 0;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Sets restitution coefficient of the material. Controls "bounciness" of an object during a collision. Value of 1
|
|
|
|
|
- * means the collision is elastic, and value of 0 means the value is inelastic. Must be in [0, 1] range.
|
|
|
|
|
|
|
+ * Controls "bounciness" of an object during a collision. Value of 1 means the collision is elastic, and value of 0
|
|
|
|
|
+ * means the value is inelastic. Must be in [0, 1] range.
|
|
|
*/
|
|
*/
|
|
|
|
|
+ BS_SCRIPT_EXPORT(n:Restitution,pr:setter)
|
|
|
virtual void setRestitutionCoefficient(float value) = 0;
|
|
virtual void setRestitutionCoefficient(float value) = 0;
|
|
|
|
|
|
|
|
- /** Gets restitution coefficient of the material. */
|
|
|
|
|
|
|
+ /** @copydoc setRestitutionCoefficient() */
|
|
|
|
|
+ BS_SCRIPT_EXPORT(n:Restitution,pr:getter)
|
|
|
virtual float getRestitutionCoefficient() const = 0;
|
|
virtual float getRestitutionCoefficient() const = 0;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -58,6 +66,7 @@ namespace bs
|
|
|
* collision is elastic, and value of 0 means the value is inelastic. Must be in
|
|
* collision is elastic, and value of 0 means the value is inelastic. Must be in
|
|
|
* [0, 1] range.
|
|
* [0, 1] range.
|
|
|
*/
|
|
*/
|
|
|
|
|
+ BS_SCRIPT_EXPORT(ec:PhysicsMaterial)
|
|
|
static HPhysicsMaterial create(float staticFriction = 0.0f, float dynamicFriction = 0.0f, float restitution = 0.0f);
|
|
static HPhysicsMaterial create(float staticFriction = 0.0f, float dynamicFriction = 0.0f, float restitution = 0.0f);
|
|
|
|
|
|
|
|
/** @name Internal
|
|
/** @name Internal
|