本文整理汇总了C#中btVector3类的典型用法代码示例。如果您正苦于以下问题:C# btVector3类的具体用法?C# btVector3怎么用?C# btVector3使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
btVector3类属于命名空间,在下文中一共展示了btVector3类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: batchedUnitVectorGetSupportingVertexWithoutMargin
public override void batchedUnitVectorGetSupportingVertexWithoutMargin( btVector3[] vectors, btVector3[] supportVerticesOut, int numVectors )
{
for( int i = 0; i < numVectors; i++ )
{
localGetSupportingVertexWithoutMargin( ref vectors[i], out supportVerticesOut[i] );
}
}
示例2: drawContactPoint
public override void drawContactPoint( ref btVector3 PointOnB, ref btVector3 normalOnB, double distance, int lifeTime, ref btVector3 color )
{
btVector3 tmpD;
PointOnB.Add( ref normalOnB, out tmpD );
drawLine( ref PointOnB, ref tmpD, ref color, ref color );
}
示例3: Multiply
public static void Multiply(ref btTransform t, ref btVector3 x, out btVector3 result)
{
result.X = t.Basis.el0.dot(x) + t.Origin.X;
result.Y = t.Basis.el1.dot(x) + t.Origin.Y;
result.Z = t.Basis.el2.dot(x) + t.Origin.Z;
result.W = 0;
}
示例4: SegmentSqrDistance
// See also geometrictools.com
// Basic idea: D = |p - (lo + t0*lv)| where t0 = lv . (p - lo) / lv . lv
double SegmentSqrDistance( ref btVector3 from, ref btVector3 to, ref btVector3 p, out btVector3 nearest )
{
btVector3 diff = p - from;
btVector3 v = to - from;
double t = v.dot( diff );
if( t > 0 )
{
double dotVV = v.dot( v );
if( t < dotVV )
{
t /= dotVV;
diff.AddScale( ref v, -t, out diff );
//diff -= t * v;
}
else
{
t = 1;
diff.Sub( ref v, out diff );
//diff -= v;
}
}
else
t = 0;
from.AddScale( ref v, t, out nearest );
//nearest = from + t * v;
return diff.dot( ref diff );
}
示例5: addContactPoint
public void addContactPoint( ref btVector3 normalOnBInWorld, ref btVector3 pointInWorld, double depth )
{
m_normalOnBInWorld = normalOnBInWorld;
m_pointInWorld = pointInWorld;
m_depth = depth;
m_hasResult = true;
}
示例6: addPoint
public void addPoint( ref btVector3 point, bool recalculateLocalAabb = true )
{
m_unscaledPoints.Add( point );
if( recalculateLocalAabb )
recalcLocalAabb();
}
示例7: project
public virtual void project( ref btTransform trans, ref btVector3 dir
, ref double min, ref double max
, out btVector3 witnesPtMin, out btVector3 witnesPtMax )
{
btVector3 localAxis; trans.m_basis.ApplyInverse( ref dir, out localAxis );
btVector3 tmpv;
localGetSupportingVertex( ref localAxis, out tmpv );
btVector3 vtx1; trans.Apply( ref tmpv, out vtx1 );
localAxis.Invert( out localAxis );
localGetSupportingVertex( ref localAxis, out tmpv );
btVector3 vtx2; trans.Apply( ref tmpv, out vtx2 );
min = vtx1.dot( ref dir );
max = vtx2.dot( ref dir );
witnesPtMax = vtx2;
witnesPtMin = vtx1;
if( min > max )
{
double tmp = min;
min = max;
max = tmp;
witnesPtMax = vtx1;
witnesPtMin = vtx2;
}
}
示例8: setSafeMargin
public void setSafeMargin( ref btVector3 halfExtents, double defaultMarginMultiplier = 0.1f )
{
//see http://code.google.com/p/bullet/issues/detail?id=349
//this margin check could could be added to other collision shapes too,
//or add some assert/warning somewhere
double minDimension = halfExtents[halfExtents.minAxis()];
setSafeMargin( minDimension, defaultMarginMultiplier );
}
示例9: btStaticPlaneShape
btStaticPlaneShape( ref btVector3 planeOrigin, ref btVector3 planeNormal ) : base()
{
planeNormal.normalized( out m_planeNormal );
m_planeConstant = planeOrigin.dot( ref planeNormal );
m_localScaling = btVector3.Zero;
m_shapeType = BroadphaseNativeTypes.STATIC_PLANE_PROXYTYPE;
// Debug.Assert( btFuzzyZero(m_planeNormal.length() - btScalar.BT_ONE) );
}
示例10: localGetSupportingVertexWithoutMargin
public override void localGetSupportingVertexWithoutMargin( ref btVector3 vec, out btVector3 result )
{
btVector3 halfExtents; getHalfExtentsWithoutMargin( out halfExtents );
result = new btVector3( btScalar.btFsels( vec.x, halfExtents.x, -halfExtents.x ),
btScalar.btFsels( vec.y, halfExtents.y, -halfExtents.y ),
btScalar.btFsels( vec.z, halfExtents.z, -halfExtents.z ) );
}
示例11: AabbExpand
public static void AabbExpand( ref btVector3 aabbMin,
ref btVector3 aabbMax,
ref btVector3 expansionMin,
ref btVector3 expansionMax )
{
aabbMin.Add( ref expansionMin, out aabbMin );
aabbMin.Add( ref expansionMax, out aabbMin );
}
示例12: btTriangleRaycastCallback
public btTriangleRaycastCallback( ref btVector3 from, ref btVector3 to, EFlags flags = EFlags.kF_None )
{
m_from = ( from );
m_to = ( to );
//@BP Mod
m_flags = ( flags );
m_hitFraction = ( btScalar.BT_ONE );
}
示例13: convexHullSupport
static void convexHullSupport( ref btVector3 localDirOrg, btVector3[] points, int numPoints, ref btVector3 localScaling, out btVector3 result )
{
btVector3 vec; localDirOrg.Mult( ref localScaling, out vec );
double maxDot;
long ptIndex = vec.maxDot( points, numPoints, out maxDot );
Debug.Assert( ptIndex >= 0 );
points[ptIndex].Mult( ref localScaling, out result );
}
示例14: setPoints
public void setPoints( btVector3[] points, int numPoints, bool computeAabb, ref btVector3 localScaling )
{
m_unscaledPoints = points;
m_numPoints = numPoints;
m_localScaling = localScaling;
if( computeAabb )
recalcLocalAabb();
}
示例15: TestAabbAgainstAabb2
public static bool TestAabbAgainstAabb2(btVector3 aabbMin1, btVector3 aabbMax1,
btVector3 aabbMin2, btVector3 aabbMax2)
{
bool overlap = true;
overlap = (aabbMin1.X > aabbMax2.X || aabbMax1.X < aabbMin2.X) ? false : overlap;
overlap = (aabbMin1.Z > aabbMax2.Z || aabbMax1.Z < aabbMin2.Z) ? false : overlap;
overlap = (aabbMin1.Y > aabbMax2.Y || aabbMax1.Y < aabbMin2.Y) ? false : overlap;
return overlap;
}