本文整理汇总了C#中Sandbox.Definitions.MyCubeBlockDefinition.GetBuildProgressModelMountPoints方法的典型用法代码示例。如果您正苦于以下问题:C# MyCubeBlockDefinition.GetBuildProgressModelMountPoints方法的具体用法?C# MyCubeBlockDefinition.GetBuildProgressModelMountPoints怎么用?C# MyCubeBlockDefinition.GetBuildProgressModelMountPoints使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sandbox.Definitions.MyCubeBlockDefinition
的用法示例。
在下文中一共展示了MyCubeBlockDefinition.GetBuildProgressModelMountPoints方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConnectionAllowed
public override bool ConnectionAllowed(ref Vector3I otherBlockPos, ref Vector3I faceNormal, MyCubeBlockDefinition def)
{
if (MountPoints == null)
return true;
var otherPos = Position + faceNormal;
var other = CubeGrid.GetCubeBlock(otherPos);
MyBlockOrientation or;
if (other != null)
or = other.Orientation;
else
or = MyBlockOrientation.Identity;
var position = Position;
m_mpCache.Clear();
if (other != null && other.FatBlock is MyFracturedBlock)
m_mpCache.AddRange((other.FatBlock as MyFracturedBlock).MountPoints);
else
{
if (other != null && other.FatBlock is MyCompoundCubeBlock)
{
var lst = new List<MyCubeBlockDefinition.MountPoint>();
foreach (var b in (other.FatBlock as MyCompoundCubeBlock).GetBlocks())
{
var mountPoints = b.BlockDefinition.GetBuildProgressModelMountPoints(b.BuildLevelRatio);
MyCubeGrid.TransformMountPoints(lst, b.BlockDefinition, mountPoints, ref b.Orientation);
m_mpCache.AddRange(lst);
}
}
else if(other != null)
{
var mountPoints = def.GetBuildProgressModelMountPoints(other.BuildLevelRatio);
MyCubeGrid.TransformMountPoints(m_mpCache, def, mountPoints, ref or);
}
}
return MyCubeGrid.CheckMountPointsForSide(MountPoints, ref SlimBlock.Orientation, ref position, BlockDefinition.Id, ref faceNormal, m_mpCache,
ref or, ref otherPos, def.Id);
}
示例2: DrawMountPoints
public static void DrawMountPoints(float cubeSize, MyCubeBlockDefinition def, ref MatrixD drawMatrix)
{
var mountPoints = def.GetBuildProgressModelMountPoints(1.0f);
if (mountPoints == null)
return;
if (!MyDebugDrawSettings.DEBUG_DRAW_MOUNT_POINTS_AUTOGENERATE)
DrawMountPoints(cubeSize, def, drawMatrix, mountPoints);
else
{ //Generate mount points from model collisions and draw them
if (def.Model != null)
{
int index = 0;
MyModel model = VRage.Game.Models.MyModels.GetModel(def.Model);
foreach (var shape in model.HavokCollisionShapes)
{
MyPhysicsDebugDraw.DrawCollisionShape(shape, drawMatrix, 0.2f, ref index);
}
var newMountPoints = AutogenerateMountpoints(model, cubeSize);
DrawMountPoints(cubeSize, def, drawMatrix, newMountPoints.ToArray());
}
}
if (MyDebugDrawSettings.DEBUG_DRAW_MOUNT_POINTS_AXIS_HELPERS)
DrawMountPointsAxisHelpers(def, ref drawMatrix, cubeSize);
}