Skip to content

raycast-vehicle-3d.entity overview


Table of contents


utils

RVEntityAxleOptions (type alias)

Signature

export type RVEntityAxleOptions = {
  halfAxleWidth: number
  axlePosition: number
  axleHeight: number
} & RVEntitySharedWheelOptions

RVEntityProperties (type alias)

Signature

export type RVEntityProperties = {
  tractionBias: RVEntityTractionBias | number
  suspension: SuspensionOptions
} & (
  | {
      wheelBase: {
        shared: RVEntitySharedWheelOptions
        front: RVEntityAxleOptions
        rear: RVEntityAxleOptions
      }
    }
  | {
      wheelOptions: (RVEntitySharedWheelOptions & {
        isLeft: boolean
        isFront: boolean
        position: Point3
      })[]
      sharedWheelOptions?: RVEntitySharedWheelOptions
    }
)

RVEntitySharedWheelOptions (type alias)

Signature

export type RVEntitySharedWheelOptions = {
  tyreWidth?: number
  tyreRadius?: number
  frictionSlip?: number
  rollInfluence?: number
  maxTravel?: number
  display?: WheelDisplayOptions
}

RaycastVehicle3dEntity (class)

Signature

export declare class RaycastVehicle3dEntity<VTypeDoc, PTypeDoc> {
  constructor(
    public readonly carProperties: RVEntityProperties,
    public readonly chassis3D: IDisplayObject3dComponent | null,
    public readonly vehicleComponent: IRaycastVehicleComponent
  )
}

getSpeed (method)

Signature

public getSpeed(): number

applyTraction (method)

Signature

public applyTraction(axle: 'front' | 'rear' | 'both', force: number)

applyBrake (method)

Signature

public applyBrake(axle: 'front' | 'rear' | 'both', force: number)

runTransformBinding (method)

Signature

protected runTransformBinding(objectBody: IRigidBody3dComponent, object3D: IDisplayObject3dComponent): void

resetTo (method)

Signature

public resetTo(
    options: {
      position?: Point3;
      rotation?: Point4;
    } = {},
  )

wheels (property)

Signature

readonly wheels: (Entity3d<VTypeDoc, PTypeDoc> | null)[]

wheelLocalRotation (property)

Signature

readonly wheelLocalRotation: (Point4 | null)[]

frontWheelsIndices (property)

Signature

readonly frontWheelsIndices: number[]

rearWheelsIndices (property)

Signature

readonly rearWheelsIndices: number[]

tractionWheelRadius (property)

Signature

readonly tractionWheelRadius: number

WheelDisplayOptions (type alias)

Signature

export type WheelDisplayOptions = {
  displayObject?: IDisplayObject3dComponent
  wheelObjectDirection?: AxisDirection3
  autoScaleMesh?: boolean
}