Class GrabbableBody
java.lang.Object
net.xmx.velthoric.core.body.VxBody
net.timtaran.interactivemc.body.type.GrabbableBody
public abstract class GrabbableBody
extends net.xmx.velthoric.core.body.VxBody
An abstract base class for bodies that can be grabbed by other bodies.
Unlike a regular rigid body, this body allows you to specify a custom grab point and grab rotation point, determining exactly where and how the body will be grabbed when another entity interacts with it.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.xmx.velthoric.core.network.synchronization.accessor.VxServerAccessor<com.github.stephengold.joltjni.Vec3> Server-side accessor for the main grab point position in local space.static final net.xmx.velthoric.core.network.synchronization.accessor.VxServerAccessor<com.github.stephengold.joltjni.Vec3> Server-side accessor for the grab point rotation reference in local space.Fields inherited from class net.xmx.velthoric.core.body.VxBody
dataStore, physicsId, physicsWorld, synchronizedData, type -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedGrabbableBody(net.xmx.velthoric.core.body.VxBodyType type, UUID id) Client-side constructor for a grabbable rigid body.protectedGrabbableBody(net.xmx.velthoric.core.body.VxBodyType type, net.xmx.velthoric.core.physics.world.VxPhysicsWorld world, UUID id) Server-side constructor for a grabbable rigid body. -
Method Summary
Modifier and TypeMethodDescriptionvoidreadPersistenceData(net.xmx.velthoric.network.VxByteBuf buf) Reads the grab point data from the persistence buffer.voidwritePersistenceData(net.xmx.velthoric.network.VxByteBuf buf) Writes the grab point data to the persistence buffer.Methods inherited from class net.xmx.velthoric.core.body.VxBody
calculateRenderState, defineSyncData, get, getBodyId, getCullingAABB, getDataStore, getDataStoreIndex, getNetworkId, getPhysicsId, getPhysicsWorld, getSynchronizedData, getTransform, getTransform, getType, getTypeId, isInitialized, onBodyAdded, onBodyAdded, onBodyRemoved, onBodyRemoved, onClientTick, onPhysicsTick, onPrePhysicsTick, onServerTick, onSyncedDataUpdated, onSyncedDataUpdated, setBodyId, setClientData, setDataStoreIndex, setNetworkId, setServerData, writeDirtySyncData, writeInitialSyncData
-
Field Details
-
DATA_MAIN_GRAB_POINT_POSITION
public static final net.xmx.velthoric.core.network.synchronization.accessor.VxServerAccessor<com.github.stephengold.joltjni.Vec3> DATA_MAIN_GRAB_POINT_POSITIONServer-side accessor for the main grab point position in local space.This defines where on the body a grabber will grab it. When pulled, the grabber's hand will align with this point.
-
DATA_MAIN_GRAB_POINT_ROTATION
public static final net.xmx.velthoric.core.network.synchronization.accessor.VxServerAccessor<com.github.stephengold.joltjni.Vec3> DATA_MAIN_GRAB_POINT_ROTATIONServer-side accessor for the grab point rotation reference in local space.This defines how the body will be rotated relative to the grabber's hand. It provides the rotation axis/reference for the grabbed body.
-
-
Constructor Details
-
GrabbableBody
protected GrabbableBody(net.xmx.velthoric.core.body.VxBodyType type, net.xmx.velthoric.core.physics.world.VxPhysicsWorld world, UUID id) Server-side constructor for a grabbable rigid body.- Parameters:
type- the body type definitionworld- the physics world this body belongs toid- the unique UUID for this body
-
GrabbableBody
Client-side constructor for a grabbable rigid body.- Parameters:
type- the body type definitionid- the unique UUID for this body
-
-
Method Details
-
writePersistenceData
public void writePersistenceData(net.xmx.velthoric.network.VxByteBuf buf) Writes the grab point data to the persistence buffer.- Parameters:
buf- the buffer to write to
-
readPersistenceData
public void readPersistenceData(net.xmx.velthoric.network.VxByteBuf buf) Reads the grab point data from the persistence buffer.- Parameters:
buf- the buffer to read from
-