‪TechbloxModdingAPI  ‪v2.2.0
‪The unofficial Techblox modding API
TechbloxModdingAPI.SimBody Class Reference

‪A rigid body (like a chunk of connected blocks) during simulation. More...

Inheritance diagram for TechbloxModdingAPI.SimBody:
TechbloxModdingAPI.EcsObjectBase

Public Member Functions

 SimBody (EGID id)
 
 SimBody (uint id)
 
bool Equals (EGID other)
 
override bool Equals (object obj)
 
bool Equals (SimBody other)
 
Block[] GetBlocks ()
 ‪The blocks that form this rigid body. More...
 
SimBody[] GetConnectedBodies ()
 ‪The rigid bodies connected to this one via functional joints (broken ones don't count). More...
 
override int GetHashCode ()
 
override string ToString ()
 

Public Attributes

Cluster Cluster
 ‪The cluster this chunk belongs to, or null if no cluster destruction manager present or the chunk doesn't exist. Get the SimBody from a Block if possible for good performance here. More...
 
bool Static => Block.BlockEngine.GetBlockInfo<MassEntityStruct>(this).isStatic
 ‪Whether the body can be moved or static. More...
 

Package Functions

 SimBody (uint id, uint clusterID)
 

Static Package Functions

static T GetInstance< T > (EGID egid, Func< EGID, T > constructor, Type type=null)
 ‪Returns a cached instance if there's an actively used instance of the object already. Objects still get garbage collected and then they will be removed from the cache. More...
 
static WeakDictionary< EGID, EcsObjectBaseGetInstances (Type type)
 

Package Attributes

EcsInitData InitData
 

Properties

float3 AngularVelocity [get, set]
 
float3 CenterOfMass [get]
 
float CurrentHealth [get, set]
 
float HealthMultiplier [get, set]
 
EGID Id [get]
 
float InitialHealth [get, set]
 
float Mass [get]
 
float3 Position [get, set]
 ‪The position of this body. When setting the position, update the position of the connected bodies as well, otherwise unexpected forces may arise. More...
 
float3 Rotation [get, set]
 
float3 Velocity [get, set]
 
float Volume [get]
 

Detailed Description

A rigid body (like a chunk of connected blocks) during simulation.

Constructor & Destructor Documentation

◆ SimBody() [1/3]

TechbloxModdingAPI.SimBody.SimBody ( EGID  id)
inline

◆ SimBody() [2/3]

TechbloxModdingAPI.SimBody.SimBody ( uint  id)
inline

◆ SimBody() [3/3]

TechbloxModdingAPI.SimBody.SimBody ( uint  id,
uint  clusterID 
)
inlinepackage

Member Function Documentation

◆ Equals() [1/3]

bool TechbloxModdingAPI.SimBody.Equals ( EGID  other)
inline

◆ Equals() [2/3]

override bool TechbloxModdingAPI.SimBody.Equals ( object  obj)
inline

◆ Equals() [3/3]

bool TechbloxModdingAPI.SimBody.Equals ( SimBody  other)
inline

◆ GetBlocks()

Block [] TechbloxModdingAPI.SimBody.GetBlocks ( )
inline

‪The blocks that form this rigid body.

Returns

◆ GetConnectedBodies()

SimBody [] TechbloxModdingAPI.SimBody.GetConnectedBodies ( )
inline

‪The rigid bodies connected to this one via functional joints (broken ones don't count).

◆ GetHashCode()

override int TechbloxModdingAPI.SimBody.GetHashCode ( )
inline

◆ GetInstance< T >()

static T TechbloxModdingAPI.EcsObjectBase.GetInstance< T > ( EGID  egid,
Func< EGID, T >  constructor,
Type  type = null 
)
inlinestaticpackageinherited

‪Returns a cached instance if there's an actively used instance of the object already. Objects still get garbage collected and then they will be removed from the cache.

Parameters
egid‪The EGID of the entity
constructor‪The constructor to construct the object
Template Parameters
T‪The object type
Returns
Type Constraints
T :EcsObjectBase 

◆ GetInstances()

static WeakDictionary<EGID, EcsObjectBase> TechbloxModdingAPI.EcsObjectBase.GetInstances ( Type  type)
inlinestaticpackageinherited

◆ ToString()

override string TechbloxModdingAPI.SimBody.ToString ( )
inline

Member Data Documentation

◆ Cluster

Cluster TechbloxModdingAPI.SimBody.Cluster
Initial value:
=> cluster # clusterId == uint.MaxValue
? Block.BlockEngine.GetCluster(‪Id.entityID)
: GetInstance(new EGID(clusterId, CommonExclusiveGroups.SIMULATION_CLUSTERS_GROUP),
egid => new ‪Cluster(egid))

‪The cluster this chunk belongs to, or null if no cluster destruction manager present or the chunk doesn't exist. Get the SimBody from a Block if possible for good performance here.

◆ InitData

EcsInitData TechbloxModdingAPI.EcsObjectBase.InitData
packageinherited

◆ Static

bool TechbloxModdingAPI.SimBody.Static => Block.BlockEngine.GetBlockInfo<MassEntityStruct>(this).isStatic

‪Whether the body can be moved or static.

Property Documentation

◆ AngularVelocity

float3 TechbloxModdingAPI.SimBody.AngularVelocity
getset

◆ CenterOfMass

float3 TechbloxModdingAPI.SimBody.CenterOfMass
get

◆ CurrentHealth

float TechbloxModdingAPI.SimBody.CurrentHealth
getset

◆ HealthMultiplier

float TechbloxModdingAPI.SimBody.HealthMultiplier
getset

◆ Id

EGID TechbloxModdingAPI.EcsObjectBase.Id
getinherited

◆ InitialHealth

float TechbloxModdingAPI.SimBody.InitialHealth
getset

◆ Mass

float TechbloxModdingAPI.SimBody.Mass
get

◆ Position

float3 TechbloxModdingAPI.SimBody.Position
getset

‪The position of this body. When setting the position, update the position of the connected bodies as well, otherwise unexpected forces may arise.

◆ Rotation

float3 TechbloxModdingAPI.SimBody.Rotation
getset

◆ Velocity

float3 TechbloxModdingAPI.SimBody.Velocity
getset

◆ Volume

float TechbloxModdingAPI.SimBody.Volume
get

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