Skip to main content

Class: Arm

Hierarchy​

  • Group

    ↳ Arm

Constructors​

constructor​

• new Arm(options?): Arm

Parameters​

NameType
optionsPartial<ArmOptions>

Returns​

Arm

Overrides​

THREE.Group.constructor

Properties​

emitSwingEvent​

• emitSwingEvent: () => void

Type declaration​

▸ (): void

Returns​

void


heldLightColor​

• heldLightColor: Color


isClickSwingEnabled​

• isClickSwingEnabled: boolean = true

Whether a left click plays the default arm swing. Consumers that own the left click and drive their own held-object animation (e.g. a gun with its own recoil) can disable this so the melee swing does not fight and rotate their viewmodel. Explicit doSwing calls are unaffected.


options​

• options: ArmOptions

Methods​

connect​

▸ connect(inputs, namespace?): () => void

Connect the arm to the given input manager. This will allow the arm to listen to left and right clicks to play arm animations. This function returns a function that when called unbinds the arm's keyboard inputs.

Parameters​

NameTypeDefault valueDescription
inputsInputs<any>undefinedThe Inputs instance to bind the arm's keyboard inputs to.
namespacestring"*"The namespace to bind the arm's keyboard inputs to.

Returns​

fn

▸ (): void

Returns​

void


doSwing​

▸ doSwing(): void

Perform an arm swing by playing the swing animation and sending an event to the network.

Returns​

void


paintArm​

▸ paintArm(texture): void

Paint the arm with a texture or color. Only works when showing the empty arm (no held object).

Parameters​

NameType
textureColor | Texture<unknown>

Returns​

void


setArmObject​

▸ setArmObject(object, animate, customType?): void

Set a new object for the arm. If animate is true, the transition will be animated.

Parameters​

NameTypeDescription
objectObject3D<Object3DEventMap>New object for the arm
animatebooleanWhether to animate the transition
customType?string-

Returns​

void


update​

▸ update(): void

Update the arm's animation. Note that when a arm is attached to a control, update is called automatically within the control's update loop.

Returns​

void


updateShadowUniforms​

▸ updateShadowUniforms(lightingUniforms, playerWorldPosition?): void

Parameters​

NameType
lightingUniformsShaderLightingUniforms
playerWorldPosition?Vector3

Returns​

void