本文整理汇总了C#中HkdBreakableShape.IsFixed方法的典型用法代码示例。如果您正苦于以下问题:C# HkdBreakableShape.IsFixed方法的具体用法?C# HkdBreakableShape.IsFixed怎么用?C# HkdBreakableShape.IsFixed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HkdBreakableShape
的用法示例。
在下文中一共展示了HkdBreakableShape.IsFixed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawBreakableShape
private void DrawBreakableShape(HkdBreakableShape breakableShape, MatrixD worldMatrix, float alpha, ref int shapeIndex, string customText = null, bool isPhantom = false)
{
//VRageRender.MyRenderProxy.DebugDrawText3D(worldMatrix.Translation, , Color.White, 1, false);
DrawCollisionShape(breakableShape.GetShape(), worldMatrix, alpha, ref shapeIndex, breakableShape.Name + " Strength: " + breakableShape.GetStrenght() + " Static:" + breakableShape.IsFixed());
if (!string.IsNullOrEmpty(breakableShape.Name) && breakableShape.Name != "PineTree175m_v2_001" && breakableShape.IsFixed())
{
}
DebugShapesPositions[breakableShape.Name] = worldMatrix.Translation;
List<HkdShapeInstanceInfo> children = new List<HkdShapeInstanceInfo>();
breakableShape.GetChildren(children);
Vector3 parentCom = breakableShape.CoM;
foreach (var shapeInst in children)
{
Matrix transform = shapeInst.GetTransform();
// transform.Translation += (shapeInst.Shape.CoM - parentCom);
Matrix trWorld = transform * worldMatrix * Matrix.CreateTranslation(Vector3.Right * 2);
DrawBreakableShape(shapeInst.Shape, trWorld, alpha, ref shapeIndex);
}
}
示例2: GetCurrentFracturedShapeList
private static bool GetCurrentFracturedShapeList(HkdBreakableShape breakableShape, List<MyObjectBuilder_FractureComponentBase.FracturedShape> shapeList, string[] excludeShapeNames = null)
{
Debug.Assert(breakableShape.IsValid());
if (!breakableShape.IsValid())
return false;
var shapeName = breakableShape.Name;
bool shapeNameEmpty = string.IsNullOrEmpty(shapeName);
if (excludeShapeNames != null && !shapeNameEmpty)
{
foreach (var shapeNameToRemove in excludeShapeNames)
{
if (shapeName == shapeNameToRemove)
return false;
}
}
if (breakableShape.GetChildrenCount() > 0)
{
List<HkdShapeInstanceInfo> shapeInst = new List<HkdShapeInstanceInfo>();
breakableShape.GetChildren(shapeInst);
bool allChildrenAdded = true;
foreach (var inst in shapeInst)
{
allChildrenAdded &= GetCurrentFracturedShapeList(inst.Shape, shapeList, excludeShapeNames: excludeShapeNames);
}
if (!shapeNameEmpty && allChildrenAdded)
{
foreach (var inst in shapeInst)
{
if (inst.Shape.IsValid())
shapeList.RemoveAll(s => s.Name == inst.ShapeName);
}
shapeList.Add(new MyObjectBuilder_FractureComponentBase.FracturedShape() { Name = shapeName, Fixed = breakableShape.IsFixed() });
}
return allChildrenAdded;
}
else
{
if (!shapeNameEmpty)
{
shapeList.Add(new MyObjectBuilder_FractureComponentBase.FracturedShape() { Name = shapeName, Fixed = breakableShape.IsFixed() });
return true;
}
}
return false;
}