add hello world example and edit source tree

This commit is contained in:
Irlan
2017-02-27 18:59:58 -03:00
parent ed0159f4b5
commit 71ee97aaa0
49 changed files with 177 additions and 14 deletions

View File

@ -21,9 +21,9 @@
#include <bounce/common/settings.h>
// Allocate 10 MiB from the stack.
// Allocate 1 MiB from the stack.
// Increase as you want.
const u32 b3_maxStackSize = B3_MiB(10);
const u32 b3_maxStackSize = B3_MiB(1);
// A stack allocator.
class b3StackAllocator

View File

@ -116,6 +116,12 @@ public:
// However, manipulating a body transform during the simulation may cause non-physical behaviour.
void SetTransform(const b3Vec3& position, const b3Vec3& axis, float32 angle);
// Get the position of the world body origin.
b3Vec3 GetPosition() const;
// Get the orientation of the world body frame.
b3Quat GetOrientation() const;
// Get the gravity scale of the body. One is used by default.
float32 GetGravityScale() const;
@ -382,6 +388,16 @@ inline void b3Body::SetTransform(const b3Vec3& position, const b3Vec3& axis, flo
SynchronizeShapes();
}
inline b3Vec3 b3Body::GetPosition() const
{
return m_sweep.worldCenter;
}
inline b3Quat b3Body::GetOrientation() const
{
return m_sweep.orientation;
}
inline b3Vec3 b3Body::GetLocalVector(const b3Vec3& vector) const
{
return b3MulT(m_xf.rotation, vector);

View File

@ -53,7 +53,7 @@ enum b3LimitState
// Return the Steiner's matrix given the displacement vector from the old
// center of rotation to the new center of rotation.
// The result equals to transpose( skew(v) ) * skew(v) or diagonal(v^2) - outer(v)
// The result equals to transpose( skew(v) ) * skew(v) or diagonal(v^2) - outer(v, v)
inline b3Mat33 b3Steiner(const b3Vec3& v)
{
float32 xx = v.x * v.x;