consistency
This commit is contained in:
@ -46,7 +46,7 @@ public:
|
|||||||
|
|
||||||
bool StartDragging()
|
bool StartDragging()
|
||||||
{
|
{
|
||||||
B3_ASSERT(m_mouseJoint == nullptr);
|
B3_ASSERT(IsDragging() == false);
|
||||||
|
|
||||||
b3RayCastSingleShapeOutput out;
|
b3RayCastSingleShapeOutput out;
|
||||||
if (m_world->RayCastSingleShape(&out, m_ray->A(), m_ray->B()) == false)
|
if (m_world->RayCastSingleShape(&out, m_ray->A(), m_ray->B()) == false)
|
||||||
@ -78,14 +78,13 @@ public:
|
|||||||
|
|
||||||
void Drag()
|
void Drag()
|
||||||
{
|
{
|
||||||
B3_ASSERT(m_mouseJoint);
|
B3_ASSERT(IsDragging() == true);
|
||||||
m_mouseJoint->SetTarget(GetPointB());
|
m_mouseJoint->SetTarget(GetPointB());
|
||||||
}
|
}
|
||||||
|
|
||||||
void StopDragging()
|
void StopDragging()
|
||||||
{
|
{
|
||||||
B3_ASSERT(m_mouseJoint);
|
B3_ASSERT(IsDragging() == true);
|
||||||
|
|
||||||
b3Body* groundBody = m_mouseJoint->GetBodyA();
|
b3Body* groundBody = m_mouseJoint->GetBodyA();
|
||||||
m_world->DestroyJoint(m_mouseJoint);
|
m_world->DestroyJoint(m_mouseJoint);
|
||||||
m_mouseJoint = nullptr;
|
m_mouseJoint = nullptr;
|
||||||
@ -100,19 +99,19 @@ public:
|
|||||||
|
|
||||||
b3Body* GetBody() const
|
b3Body* GetBody() const
|
||||||
{
|
{
|
||||||
B3_ASSERT(m_shape);
|
B3_ASSERT(IsDragging() == true);
|
||||||
return m_shape->GetBody();
|
return m_shape->GetBody();
|
||||||
}
|
}
|
||||||
|
|
||||||
b3Vec3 GetPointA() const
|
b3Vec3 GetPointA() const
|
||||||
{
|
{
|
||||||
B3_ASSERT(m_shape);
|
B3_ASSERT(IsDragging() == true);
|
||||||
return m_shape->GetBody()->GetWorldPoint(m_p);
|
return m_shape->GetBody()->GetWorldPoint(m_p);
|
||||||
}
|
}
|
||||||
|
|
||||||
b3Vec3 GetPointB() const
|
b3Vec3 GetPointB() const
|
||||||
{
|
{
|
||||||
B3_ASSERT(m_mouseJoint);
|
B3_ASSERT(IsDragging() == true);
|
||||||
return (1.0f - m_x) * m_ray->A() + m_x * m_ray->B();
|
return (1.0f - m_x) * m_ray->A() + m_x * m_ray->B();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,10 +120,10 @@ private:
|
|||||||
float32 m_x;
|
float32 m_x;
|
||||||
|
|
||||||
b3World* m_world;
|
b3World* m_world;
|
||||||
|
|
||||||
b3Shape* m_shape;
|
b3Shape* m_shape;
|
||||||
b3Vec3 m_p;
|
b3Vec3 m_p;
|
||||||
b3MouseJoint* m_mouseJoint;
|
b3MouseJoint* m_mouseJoint;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -210,6 +210,7 @@ private:
|
|||||||
float32 m_x;
|
float32 m_x;
|
||||||
|
|
||||||
b3World* m_world;
|
b3World* m_world;
|
||||||
|
|
||||||
b3Cloth* m_cloth;
|
b3Cloth* m_cloth;
|
||||||
b3ClothMesh* m_mesh;
|
b3ClothMesh* m_mesh;
|
||||||
b3ClothMeshTriangle* m_triangle;
|
b3ClothMeshTriangle* m_triangle;
|
||||||
|
@ -525,8 +525,8 @@ bool b3World::RayCastSingleCloth(b3RayCastSingleClothOutput* output, const b3Vec
|
|||||||
b3Vec3 point = (1.0f - fraction) * p1 + fraction * p2;
|
b3Vec3 point = (1.0f - fraction) * p1 + fraction * p2;
|
||||||
b3Vec3 normal = output0.normal;
|
b3Vec3 normal = output0.normal;
|
||||||
|
|
||||||
output->triangle = triangle;
|
|
||||||
output->cloth = cloth0;
|
output->cloth = cloth0;
|
||||||
|
output->triangle = triangle;
|
||||||
output->point = point;
|
output->point = point;
|
||||||
output->normal = normal;
|
output->normal = normal;
|
||||||
output->fraction = fraction;
|
output->fraction = fraction;
|
||||||
|
Reference in New Issue
Block a user