Class PlayerBodyPartRigidBody
java.lang.Object
net.xmx.velthoric.core.body.VxBody
net.timtaran.interactivemc.body.player.PlayerBodyPartRigidBody
public class PlayerBodyPartRigidBody
extends net.xmx.velthoric.core.body.VxBody
A dynamic rigid body representing a player's body part (head, hands, etc.).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.xmx.velthoric.core.network.synchronization.accessor.VxServerAccessor<PlayerBodyPart> The type of body part (head, hands, etc.).static final net.xmx.velthoric.core.network.synchronization.accessor.VxServerAccessor<com.github.stephengold.joltjni.Vec3> The half-extents (dimensions) of this body part.static final net.xmx.velthoric.core.network.synchronization.accessor.VxServerAccessor<UUID> The UUID of the player who owns this body part.Fields inherited from class net.xmx.velthoric.core.body.VxBody
dataStore, physicsId, physicsWorld, synchronizedData, type -
Constructor Summary
ConstructorsConstructorDescriptionPlayerBodyPartRigidBody(net.xmx.velthoric.core.body.VxBodyType type, UUID id) Client-side constructor.PlayerBodyPartRigidBody(net.xmx.velthoric.core.body.VxBodyType type, net.xmx.velthoric.core.physics.world.VxPhysicsWorld world, UUID id) Server-side constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic intcreateJoltBody(net.xmx.velthoric.core.body.VxBody body, net.xmx.velthoric.core.body.factory.VxRigidBodyFactory factory) protected voiddefineSyncData(net.xmx.velthoric.core.network.synchronization.VxSynchronizedData.Builder builder) voidonBodyRemoved(net.minecraft.client.multiplayer.ClientLevel level) voidvoidonPhysicsTick(net.xmx.velthoric.core.physics.world.VxPhysicsWorld world) Called during each physics tick.static voidreadPersistenceData(net.xmx.velthoric.core.body.VxBody body, net.xmx.velthoric.network.VxByteBuf buf) static voidwritePersistenceData(net.xmx.velthoric.core.body.VxBody body, net.xmx.velthoric.network.VxByteBuf buf) Methods inherited from class net.xmx.velthoric.core.body.VxBody
calculateRenderState, get, getBodyId, getCullingAABB, getDataStore, getDataStoreIndex, getNetworkId, getPhysicsId, getPhysicsWorld, getSynchronizedData, getTransform, getTransform, getType, getTypeId, isInitialized, onBodyAdded, onBodyAdded, onBodyRemoved, onPrePhysicsTick, onServerTick, onSyncedDataUpdated, onSyncedDataUpdated, setBodyId, setClientData, setDataStoreIndex, setNetworkId, setServerData, writeDirtySyncData, writeInitialSyncData
-
Field Details
-
DATA_HALF_EXTENTS
public static final net.xmx.velthoric.core.network.synchronization.accessor.VxServerAccessor<com.github.stephengold.joltjni.Vec3> DATA_HALF_EXTENTSThe half-extents (dimensions) of this body part. -
DATA_BODY_PART
public static final net.xmx.velthoric.core.network.synchronization.accessor.VxServerAccessor<PlayerBodyPart> DATA_BODY_PARTThe type of body part (head, hands, etc.). -
DATA_PLAYER_ID
public static final net.xmx.velthoric.core.network.synchronization.accessor.VxServerAccessor<UUID> DATA_PLAYER_IDThe UUID of the player who owns this body part.
-
-
Constructor Details
-
PlayerBodyPartRigidBody
public PlayerBodyPartRigidBody(net.xmx.velthoric.core.body.VxBodyType type, net.xmx.velthoric.core.physics.world.VxPhysicsWorld world, UUID id) Server-side constructor.- Parameters:
type- the body typeworld- the physics worldid- the unique identifier for this body
-
PlayerBodyPartRigidBody
@Environment(CLIENT) public PlayerBodyPartRigidBody(net.xmx.velthoric.core.body.VxBodyType type, UUID id) Client-side constructor.- Parameters:
type- the body typeid- the unique identifier for this body
-
-
Method Details
-
defineSyncData
protected void defineSyncData(net.xmx.velthoric.core.network.synchronization.VxSynchronizedData.Builder builder) - Overrides:
defineSyncDatain classnet.xmx.velthoric.core.body.VxBody
-
createJoltBody
public static int createJoltBody(net.xmx.velthoric.core.body.VxBody body, net.xmx.velthoric.core.body.factory.VxRigidBodyFactory factory) -
onPhysicsTick
public void onPhysicsTick(net.xmx.velthoric.core.physics.world.VxPhysicsWorld world) Called during each physics tick. Override this method in subclasses if additional physics processing is needed.- Overrides:
onPhysicsTickin classnet.xmx.velthoric.core.body.VxBody- Parameters:
world- the physics world
-
writePersistenceData
public static void writePersistenceData(net.xmx.velthoric.core.body.VxBody body, net.xmx.velthoric.network.VxByteBuf buf) -
readPersistenceData
public static void readPersistenceData(net.xmx.velthoric.core.body.VxBody body, net.xmx.velthoric.network.VxByteBuf buf) -
onBodyRemoved
public void onBodyRemoved(net.minecraft.client.multiplayer.ClientLevel level) - Overrides:
onBodyRemovedin classnet.xmx.velthoric.core.body.VxBody
-
onClientTick
public void onClientTick()- Overrides:
onClientTickin classnet.xmx.velthoric.core.body.VxBody
-