Space Engineers
Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
Sandbox.Game.Entities.MyGridSkeleton Class Reference

Public Member Functions

 MyGridSkeleton ()
 
void Reset ()
 
void CopyTo (MyGridSkeleton target, Vector3I fromGridPosition, Vector3I toGridPosition)
 Copies part of skeleton to other skeleton, both positions are inclusive More...
 
void CopyTo (MyGridSkeleton target, MatrixI transformationMatrix, MyCubeGrid targetGrid)
 
void FixBone (Vector3I gridPosition, Vector3I boneOffset, float gridSize, float minBoneDist=0.05f)
 Fixes bone in way that it won't be further than neighbour bones. This helps fix invalid triangles during rendering. More...
 
void Serialize (List< BoneInfo > result, float boneRange, MyCubeGrid grid)
 
void Deserialize (List< BoneInfo > data, float boneRange, float gridSize, bool clear=false)
 
void SerializePart (Vector3I minBone, Vector3I maxBone, float boneRange, List< byte > result)
 
void DeserializePart (Vector3I minBone, Vector3I maxBone, float boneRange, List< byte > data)
 
Vector3 GetBone (Vector3I cubePos, Vector3I bonePos)
 
void GetBone (ref Vector3I pos, out Vector3 bone)
 
bool TryGetBone (ref Vector3I pos, out Vector3 bone)
 
void SetBone (ref Vector3I pos, ref Vector3 bone)
 
void SetOrClearBone (ref Vector3I pos, ref Vector3 bone)
 
bool ClearBone (ref Vector3I pos)
 Returns true when bone was really removed More...
 
bool MultiplyBone (ref Vector3I pos, float factor, ref Vector3I cubePos, MyCubeGrid cubeGrid, float epsilon=0.005f)
 Returns true when bone was changed. When new bone offset length is smaller than epsilon, it will remove bone. Factor is used as t paramter in a lerp. This is because the default position for a bone may not be 0 More...
 
bool IsDeformed (Vector3I cube, float ignoredDeformation, MyCubeGrid cubeGrid, bool checkBlockDefinition)
 
float MaxDeformation (Vector3I cube, MyCubeGrid cubeGrid)
 
void Wrap (ref Vector3I cube, ref Vector3I boneOffset)
 Bone offset is normally between 0 and BoneDensity (including) This function takes any other values and transforms it into cube and proper bone offset More...
 
void GetAffectedCubes (Vector3I cube, Vector3I boneOffset, List< Vector3I > resultList, MyCubeGrid grid)
 Gets all cubes which are affected by bone. More...
 
void GetCubeBox (Vector3I cubePos, out Vector3 lowerBone, out Vector3 upperBone, float?clampTo)
 
void MarkCubeRemoved (ref Vector3I pos)
 
void RemoveUnusedBones (MyCubeGrid grid)
 
Vector3 GetDefinitionOffsetWithNeighbours (Vector3I cubePos, Vector3I bonePos, MyCubeGrid grid)
 

Static Public Member Functions

static float GetMaxBoneError (float gridSize)
 

Public Attributes

readonly Dictionary< Vector3I, Vector3Bones = new Dictionary<Vector3I, Vector3>()
 
const int BoneDensity = 2
 Density multiplier More...
 
readonly Vector3I[] BoneOffsets
 

Properties

Vector3 this[Vector3I pos] [get, set]
 

Detailed Description

Definition at line 15 of file MyGridSkeleton.cs.

Constructor & Destructor Documentation

Sandbox.Game.Entities.MyGridSkeleton.MyGridSkeleton ( )
inline

Definition at line 49 of file MyGridSkeleton.cs.

Member Function Documentation

bool Sandbox.Game.Entities.MyGridSkeleton.ClearBone ( ref Vector3I  pos)
inline

Returns true when bone was really removed

Definition at line 342 of file MyGridSkeleton.cs.

void Sandbox.Game.Entities.MyGridSkeleton.CopyTo ( MyGridSkeleton  target,
Vector3I  fromGridPosition,
Vector3I  toGridPosition 
)
inline

Copies part of skeleton to other skeleton, both positions are inclusive

Definition at line 71 of file MyGridSkeleton.cs.

void Sandbox.Game.Entities.MyGridSkeleton.CopyTo ( MyGridSkeleton  target,
MatrixI  transformationMatrix,
MyCubeGrid  targetGrid 
)
inline

Definition at line 98 of file MyGridSkeleton.cs.

void Sandbox.Game.Entities.MyGridSkeleton.Deserialize ( List< BoneInfo data,
float  boneRange,
float  gridSize,
bool  clear = false 
)
inline

Definition at line 242 of file MyGridSkeleton.cs.

void Sandbox.Game.Entities.MyGridSkeleton.DeserializePart ( Vector3I  minBone,
Vector3I  maxBone,
float  boneRange,
List< byte >  data 
)
inline

Definition at line 276 of file MyGridSkeleton.cs.

void Sandbox.Game.Entities.MyGridSkeleton.FixBone ( Vector3I  gridPosition,
Vector3I  boneOffset,
float  gridSize,
float  minBoneDist = 0.05f 
)
inline

Fixes bone in way that it won't be further than neighbour bones. This helps fix invalid triangles during rendering.

Definition at line 148 of file MyGridSkeleton.cs.

void Sandbox.Game.Entities.MyGridSkeleton.GetAffectedCubes ( Vector3I  cube,
Vector3I  boneOffset,
List< Vector3I resultList,
MyCubeGrid  grid 
)
inline

Gets all cubes which are affected by bone.

Parameters
onlyExistingReturns only cubes which were added to skeleton.

Definition at line 489 of file MyGridSkeleton.cs.

Vector3 Sandbox.Game.Entities.MyGridSkeleton.GetBone ( Vector3I  cubePos,
Vector3I  bonePos 
)
inline

Definition at line 303 of file MyGridSkeleton.cs.

void Sandbox.Game.Entities.MyGridSkeleton.GetBone ( ref Vector3I  pos,
out Vector3  bone 
)
inline

Definition at line 313 of file MyGridSkeleton.cs.

void Sandbox.Game.Entities.MyGridSkeleton.GetCubeBox ( Vector3I  cubePos,
out Vector3  lowerBone,
out Vector3  upperBone,
float?  clampTo 
)
inline

Definition at line 511 of file MyGridSkeleton.cs.

Vector3 Sandbox.Game.Entities.MyGridSkeleton.GetDefinitionOffsetWithNeighbours ( Vector3I  cubePos,
Vector3I  bonePos,
MyCubeGrid  grid 
)
inline

Definition at line 628 of file MyGridSkeleton.cs.

static float Sandbox.Game.Entities.MyGridSkeleton.GetMaxBoneError ( float  gridSize)
inlinestatic

Definition at line 44 of file MyGridSkeleton.cs.

bool Sandbox.Game.Entities.MyGridSkeleton.IsDeformed ( Vector3I  cube,
float  ignoredDeformation,
MyCubeGrid  cubeGrid,
bool  checkBlockDefinition 
)
inline

Definition at line 407 of file MyGridSkeleton.cs.

void Sandbox.Game.Entities.MyGridSkeleton.MarkCubeRemoved ( ref Vector3I  pos)
inline

Definition at line 529 of file MyGridSkeleton.cs.

float Sandbox.Game.Entities.MyGridSkeleton.MaxDeformation ( Vector3I  cube,
MyCubeGrid  cubeGrid 
)
inline

Definition at line 442 of file MyGridSkeleton.cs.

bool Sandbox.Game.Entities.MyGridSkeleton.MultiplyBone ( ref Vector3I  pos,
float  factor,
ref Vector3I  cubePos,
MyCubeGrid  cubeGrid,
float  epsilon = 0.005f 
)
inline

Returns true when bone was changed. When new bone offset length is smaller than epsilon, it will remove bone. Factor is used as t paramter in a lerp. This is because the default position for a bone may not be 0

Definition at line 353 of file MyGridSkeleton.cs.

void Sandbox.Game.Entities.MyGridSkeleton.RemoveUnusedBones ( MyCubeGrid  grid)
inline

Definition at line 534 of file MyGridSkeleton.cs.

void Sandbox.Game.Entities.MyGridSkeleton.Reset ( )
inline

Definition at line 63 of file MyGridSkeleton.cs.

void Sandbox.Game.Entities.MyGridSkeleton.Serialize ( List< BoneInfo result,
float  boneRange,
MyCubeGrid  grid 
)
inline

Definition at line 184 of file MyGridSkeleton.cs.

void Sandbox.Game.Entities.MyGridSkeleton.SerializePart ( Vector3I  minBone,
Vector3I  maxBone,
float  boneRange,
List< byte >  result 
)
inline

Definition at line 258 of file MyGridSkeleton.cs.

void Sandbox.Game.Entities.MyGridSkeleton.SetBone ( ref Vector3I  pos,
ref Vector3  bone 
)
inline

Definition at line 326 of file MyGridSkeleton.cs.

void Sandbox.Game.Entities.MyGridSkeleton.SetOrClearBone ( ref Vector3I  pos,
ref Vector3  bone 
)
inline

Definition at line 331 of file MyGridSkeleton.cs.

bool Sandbox.Game.Entities.MyGridSkeleton.TryGetBone ( ref Vector3I  pos,
out Vector3  bone 
)
inline

Definition at line 321 of file MyGridSkeleton.cs.

void Sandbox.Game.Entities.MyGridSkeleton.Wrap ( ref Vector3I  cube,
ref Vector3I  boneOffset 
)
inline

Bone offset is normally between 0 and BoneDensity (including) This function takes any other values and transforms it into cube and proper bone offset

Definition at line 478 of file MyGridSkeleton.cs.

Member Data Documentation

const int Sandbox.Game.Entities.MyGridSkeleton.BoneDensity = 2

Density multiplier

Definition at line 36 of file MyGridSkeleton.cs.

readonly Vector3I [] Sandbox.Game.Entities.MyGridSkeleton.BoneOffsets

Definition at line 38 of file MyGridSkeleton.cs.

readonly Dictionary<Vector3I, Vector3> Sandbox.Game.Entities.MyGridSkeleton.Bones = new Dictionary<Vector3I, Vector3>()

Definition at line 17 of file MyGridSkeleton.cs.

Property Documentation

Vector3 Sandbox.Game.Entities.MyGridSkeleton.this[Vector3I pos]
getset

Definition at line 382 of file MyGridSkeleton.cs.


The documentation for this class was generated from the following file: