コード例 #1
0
ファイル: joints.cpp プロジェクト: yushiming/CS
csVector3 csBulletPivotJoint::GetPosition () const
{
  if (!constraint)
    return csVector3 (0.0f);

  return BulletToCS (constraint->getPivotInB (), dynSys->inverseInternalScale);
}
コード例 #2
0
csVector3 csBulletRigidBody::GetLinearVelocity (size_t index /* = 0 */) const
{
  if (!btBody)
    return linearVelocity;

  const btVector3& vel = btBody->getLinearVelocity ();
  return BulletToCS (vel, system->getInverseInternalScale ());
}
コード例 #3
0
ファイル: colliders.cpp プロジェクト: yushiming/CS
    bool csBulletCollider::GetBoxGeometry (csVector3& size)
    {
        if (geomType != BOX_COLLIDER_GEOMETRY)
            return false;

        btBoxShape* geometry = static_cast<btBoxShape*> (shape);
        btVector3 btSize = geometry->getHalfExtentsWithMargin ();
        size.Set (BulletToCS (btSize, dynSys->inverseInternalScale));
        size *= 2.0f;

        return true;
    }
コード例 #4
0
ファイル: colliders.cpp プロジェクト: yushiming/CS
    bool csBulletCollider::GetConvexMeshGeometry (csVector3*& vertices, size_t& vertexCount,
            int*& indices, size_t& triangleCount)
    {
        if (geomType != CONVEXMESH_COLLIDER_GEOMETRY)
            return false;

        triangleCount = this->triangleCount;
        delete[] indices;
        indices = new int[this->triangleCount * 3];
        for (unsigned int i = 0; i < triangleCount * 3; i++)
            indices[i] = this->indices[i];

        vertexCount = this->vertexCount;
        delete[] vertices;
        vertices = new csVector3[this->vertexCount];
        for (unsigned int i = 0; i < vertexCount; i++)
            vertices[i].Set (BulletToCS (this->vertices[i], dynSys->inverseInternalScale));

        return true;
    }