本文整理汇总了C++中btVector3::setInterpolate3方法的典型用法代码示例。如果您正苦于以下问题:C++ btVector3::setInterpolate3方法的具体用法?C++ btVector3::setInterpolate3怎么用?C++ btVector3::setInterpolate3使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类btVector3
的用法示例。
在下文中一共展示了btVector3::setInterpolate3方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addSingleResult
virtual btScalar addSingleResult(btCollisionWorld::LocalRayResult& rayResult, bool normalInWorldSpace)
{
if (rayResult.m_collisionObject == m_exclude) return 1.0;
//caller already does the filter on the m_closestHitFraction
btAssert(rayResult.m_hitFraction <= m_closestHitFraction);
m_closestHitFraction = rayResult.m_hitFraction;
m_collisionObject = rayResult.m_collisionObject;
if (rayResult.m_localShapeInfo)
{
#ifndef EXTBULLET
m_shape = rayResult.m_localShapeInfo->m_shape;
#endif
m_shapePart = rayResult.m_localShapeInfo->m_shapePart;
m_triangleId = rayResult.m_localShapeInfo->m_triangleIndex;
}
if (normalInWorldSpace)
{
m_hitNormalWorld = rayResult.m_hitNormalLocal;
}
else
{
///need to transform normal into worldspace
m_hitNormalWorld = m_collisionObject->getWorldTransform().getBasis() * rayResult.m_hitNormalLocal;
}
m_hitPointWorld.setInterpolate3(m_rayFromWorld,m_rayToWorld,rayResult.m_hitFraction);
return rayResult.m_hitFraction;
}
示例2: addSingleResult
virtual btScalar addSingleResult(btCollisionWorld::LocalRayResult& rayResult,bool normalInWorldSpace)
{
elfCollision* collision;
m_collisionObject = rayResult.m_collisionObject;
if (normalInWorldSpace)
{
m_hitNormalWorld = rayResult.m_hitNormalLocal;
}
else
{
m_hitNormalWorld = m_collisionObject->getWorldTransform().getBasis()*rayResult.m_hitNormalLocal;
}
m_hitPointWorld.setInterpolate3(m_rayFromWorld, m_rayToWorld, rayResult.m_hitFraction);
collision = elfCreateCollision();
collision->position.x = m_hitPointWorld.x();
collision->position.y = m_hitPointWorld.y();
collision->position.z = m_hitPointWorld.z();
collision->normal.x = m_hitNormalWorld.x();
collision->normal.y = m_hitNormalWorld.y();
collision->normal.z = m_hitNormalWorld.z();
collision->actor = ((elfPhysicsObject*)((btRigidBody*)m_collisionObject)->getUserPointer())->actor;
elfIncRef((elfObject*)collision->actor);
elfAppendListObject(m_list, (elfObject*)collision);
return rayResult.m_hitFraction;
}
示例3:
virtual btScalar addSingleResult(btCollisionWorld::LocalRayResult& rayResult, bool normalInWorldSpace)
{
if (rayResult.m_collisionObject == m_exclude)
return 1.0;
// fluid triggers - no collision
if (rayResult.m_collisionObject->getCollisionFlags() & btCollisionObject::CF_NO_CONTACT_RESPONSE)
return 1.0;
//caller already does the filter on the m_closestHitFraction
btAssert(rayResult.m_hitFraction <= m_closestHitFraction);
m_closestHitFraction = rayResult.m_hitFraction;
m_collisionObject = rayResult.m_collisionObject;
if (!rayResult.m_localShapeInfo)
m_shapeId = 0; //crash hf-
else // only for btTriangleMeshShape
m_shapeId = rayResult.m_localShapeInfo->m_shapePart;
if (normalInWorldSpace)
{
m_hitNormalWorld = rayResult.m_hitNormalLocal;
}
else
{
///need to transform normal into worldspace
m_hitNormalWorld = m_collisionObject->getWorldTransform().getBasis()*rayResult.m_hitNormalLocal;
}
m_hitPointWorld.setInterpolate3(m_rayFromWorld,m_rayToWorld,rayResult.m_hitFraction);
return rayResult.m_hitFraction;
}
示例4: addSingleResult
virtual btScalar addSingleResult(btCollisionWorld::LocalRayResult& rayResult, bool normalInWorldSpace) {
if (normalInWorldSpace) {
m_hitNormalWorld = rayResult.m_hitNormalLocal;
} else {
m_hitNormalWorld = m_collisionObject->getWorldTransform().getBasis() * rayResult.m_hitNormalLocal;
}
m_hitPointWorld.setInterpolate3(m_rayFromWorld, m_rayToWorld, rayResult.m_hitFraction);
jmeBulletUtil::addResult(env, resultlist, m_hitNormalWorld, m_hitPointWorld, rayResult.m_hitFraction, rayResult.m_collisionObject);
return 1.f;
}
示例5:
virtual btScalar addSingleResult(btCollisionWorld::LocalRayResult& rayResult, bool normalInWorldSpace)
{
btCollisionObject* obj = rayResult.m_collisionObject;
if (obj == m_exclude)
return 1.0;
// no other cars collision (for wheel raycasts)
ShapeData* sd = (ShapeData*)obj->getUserPointer();
if (bIgnoreCars && sd && sd->type == ST_Car)
return 1.0;
// car ignores fluids (camera not)
if (!bCamTilt && sd && sd->type == ST_Fluid)
return 1.0;
// always ignore wheel triggers
if (sd && sd->type == ST_Wheel) // && (obj->getCollisionFlags() & btCollisionObject::CF_NO_CONTACT_RESPONSE))
return 1.0;
// cam ingores dynamic objects (car not)
if (bCamTilt && !obj->isStaticObject())
return 1.0;
// cam dist ray only for terrain, // todo: would work for rest but loops and pipe glass ..
if (bCamDist)
{
int su = (long)obj->getCollisionShape()->getUserPointer();
if (su != SU_Terrain)
return 1.0;
}
//caller already does the filter on the m_closestHitFraction
btAssert(rayResult.m_hitFraction <= m_closestHitFraction);
m_closestHitFraction = rayResult.m_hitFraction;
m_collisionObject = obj;
if (!rayResult.m_localShapeInfo)
m_shapeId = 0; //crash hf-
else // only for btTriangleMeshShape
m_shapeId = rayResult.m_localShapeInfo->m_shapePart;
if (normalInWorldSpace)
m_hitNormalWorld = rayResult.m_hitNormalLocal;
else ///need to transform normal into worldspace
m_hitNormalWorld = m_collisionObject->getWorldTransform().getBasis()*rayResult.m_hitNormalLocal;
m_hitPointWorld.setInterpolate3(m_rayFromWorld,m_rayToWorld,rayResult.m_hitFraction);
return rayResult.m_hitFraction;
}
示例6:
virtual btScalar addSingleResult(LocalRayResult& rayResult,bool normalInWorldSpace)
{
//caller already does the filter on the m_closestHitFraction
btAssert(rayResult.m_hitFraction <= m_closestHitFraction);
m_closestHitFraction = rayResult.m_hitFraction;
m_collisionObject = rayResult.m_collisionObject;
if (normalInWorldSpace)
{
m_hitNormalWorld = rayResult.m_hitNormalLocal;
} else
{
///need to transform normal into worldspace
m_hitNormalWorld = m_collisionObject->getWorldTransform().getBasis()*rayResult.m_hitNormalLocal;
}
m_hitPointWorld.setInterpolate3(m_rayFromWorld,m_rayToWorld,rayResult.m_hitFraction);
return 1.f;
}
示例7: addSingleResult
virtual btScalar addSingleResult(btCollisionWorld::LocalRayResult& rayResult, bool normalInWorldSpace)
{
const btCollisionObject* obj = rayResult.m_collisionObject;
if (obj->getUserPointer() != (void*)111) // allow only road
return 1.0;
//caller already does the filter on the m_closestHitFraction
btAssert(rayResult.m_hitFraction <= m_closestHitFraction);
m_closestHitFraction = rayResult.m_hitFraction;
m_collisionObject = obj;
if (normalInWorldSpace)
m_hitNormalWorld = rayResult.m_hitNormalLocal;
else ///need to transform normal into worldspace
m_hitNormalWorld = m_collisionObject->getWorldTransform().getBasis()*rayResult.m_hitNormalLocal;
m_hitPointWorld.setInterpolate3(m_rayFromWorld,m_rayToWorld,rayResult.m_hitFraction);
return rayResult.m_hitFraction;
}