Strata - v1.4.10
    Preparing search index...

    Interface BuoyancyProps

    Props for the Buoyancy component.

    interface BuoyancyProps {
        activeCollisionTypes?: ActiveCollisionTypes;
        additionalSolverIterations?: number;
        angularDamping?: number;
        angularVelocity?: Vector3Tuple;
        args?: any;
        canSleep?: boolean;
        ccd?: boolean;
        children?: ReactNode;
        colliders?: RigidBodyAutoCollider;
        collisionGroups?: number;
        config?: Partial<BuoyancyConfig>;
        contactSkin?: number;
        density?: number;
        dominanceGroup?: number;
        enabledRotations?: Boolean3Tuple;
        enabledTranslations?: Boolean3Tuple;
        friction?: number;
        frictionCombineRule?: CoefficientCombineRule;
        gravityScale?: number;
        includeInvisible?: boolean;
        linearDamping?: number;
        linearVelocity?: Vector3Tuple;
        lockRotations?: boolean;
        lockTranslations?: boolean;
        mass?: number;
        massProperties?: {
            angularInertiaLocalFrame: Rotation;
            centerOfMass: Vector;
            mass: number;
            principalAngularInertia: Vector;
        };
        name?: string;
        onCollisionEnter?: CollisionEnterHandler;
        onCollisionExit?: CollisionExitHandler;
        onContactForce?: ContactForceHandler;
        onIntersectionEnter?: IntersectionEnterHandler;
        onIntersectionExit?: IntersectionExitHandler;
        onSleep?: () => void;
        onSubmerged?: (depth: number) => void;
        onWake?: () => void;
        position?:
            | number
            | Vector3
            | [x: number, y: number, z: number]
            | readonly [number, number, number]
            | Readonly<Vector3>;
        principalAngularInertia?: Vector3Tuple;
        quaternion?:
            | Quaternion
            | [x: number, y: number, z: number, w: number]
            | readonly [number, number, number, number]
            | Readonly<Quaternion>;
        restitution?: number;
        restitutionCombineRule?: CoefficientCombineRule;
        rotation?:
            | number
            | Euler
            | [x: number, y: number, z: number, order?: EulerOrder]
            | readonly [number, number, number, EulerOrder | undefined]
            | Readonly<Euler>;
        samplePoints?: [number, number, number][];
        scale?:
            | number
            | Vector3
            | [x: number, y: number, z: number]
            | readonly [number, number, number]
            | Readonly<Vector3>;
        sensor?: boolean;
        shape?: ColliderShape;
        softCcdPrediction?: number;
        solverGroups?: number;
        type?: RigidBodyTypeString;
        userData?: Record<string, any> | Readonly<Record<string, any> | undefined>;
    }

    Hierarchy

    • Omit<RigidBodyProps, "ref">
      • BuoyancyProps
    Index

    Properties

    activeCollisionTypes?: ActiveCollisionTypes

    The default active collision types for all colliders in this rigid body. Can be customized per-collider.

    Use ActiveCollisionTypes to specify which collision types should be active for this collider.

    additionalSolverIterations?: number

    Sets the number of additional solver iterations that will be run for this rigid-body and everything that interacts with it directly or indirectly through contacts or joints.

    Compared to increasing the global World.numSolverIteration, setting this value lets you increase accuracy on only a subset of the scene, resulting in reduced performance loss.

    angularDamping?: number

    The angular damping coefficient of this rigid-body.

    angularVelocity?: Vector3Tuple

    The initial angular velocity of this body.

    [0,0,0]
    
    args?: any

    Arguments to pass to the collider

    canSleep?: boolean

    Whether or not this body can sleep.

    true
    
    ccd?: boolean

    Whether or not Continous Collision Detection is enabled for this rigid-body. https://rapier.rs/docs/user_guides/javascript/rigid_bodies#continuous-collision-detection

    false
    
    children?: ReactNode

    Child mesh components.

    colliders?: RigidBodyAutoCollider

    Automatically generate colliders based on meshes inside this rigid body.

    You can change the default setting globally by setting the colliders prop on the component.

    Setting this to false will disable automatic colliders.

    collisionGroups?: number

    The default collision groups bitmask for all colliders in this rigid body. Can be customized per-collider.

    config?: Partial<BuoyancyConfig>

    Buoyancy simulation settings (water level, drag, force).

    contactSkin?: number

    The contact skin of the collider.

    The contact skin acts as if the collider was enlarged with a skin of width contactSkin around it, keeping objects further apart when colliding.

    A non-zero contact skin can increase performance, and in some cases, stability. However it creates a small gap between colliding object (equal to the sum of their skin). If the skin is sufficiently small, this might not be visually significant or can be hidden by the rendering assets.

    0
    
    density?: number

    Sets the uniform density of this collider. If this is set, other mass-properties like the angular inertia tensor are computed automatically from the collider's shape. Cannot be used at the same time as the mass or massProperties values. More info https://rapier.rs/docs/user_guides/javascript/colliders#mass-properties

    dominanceGroup?: number

    The dominance group of this RigidBody. If a rigid body has a higher domiance group, on collision it will be immune to forces originating from the other bodies. https://rapier.rs/docs/user_guides/javascript/rigid_bodies#dominance Default: 0

    enabledRotations?: Boolean3Tuple

    Allow rotation of this rigid-body only along specific axes.

    enabledTranslations?: Boolean3Tuple

    Allow translation of this rigid-body only along specific axes.

    friction?: number

    Set the friction of auto-generated colliders. This does not affect any non-automatic child collider-components.

    frictionCombineRule?: CoefficientCombineRule
    gravityScale?: number

    The scaling factor applied to the gravity affecting the rigid-body.

    1.0
    
    includeInvisible?: boolean

    Include invisible objects on the collider creation estimation.

    linearDamping?: number

    The linear damping coefficient of this rigid-body.

    linearVelocity?: Vector3Tuple

    The initial linear velocity of this body.

    [0,0,0]
    
    lockRotations?: boolean

    Locks all rotations that would have resulted from forces on the created rigid-body.

    lockTranslations?: boolean

    Locks all translations that would have resulted from forces on the created rigid-body.

    mass?: number

    The mass of this collider. Generally, it's not recommended to adjust the mass properties as it could lead to unexpected behaviors. Cannot be used at the same time as the density or massProperties values. More info https://rapier.rs/docs/user_guides/javascript/colliders#mass-properties

    massProperties?: {
        angularInertiaLocalFrame: Rotation;
        centerOfMass: Vector;
        mass: number;
        principalAngularInertia: Vector;
    }

    The mass properties of this rigid body. Cannot be used at the same time as the density or mass values.

    name?: string

    The optional name passed to THREE's Object3D

    onCollisionEnter?: CollisionEnterHandler

    Callback when this collider collideas with another collider.

    onCollisionExit?: CollisionExitHandler

    Callback when this collider stops colliding with another collider.

    onContactForce?: ContactForceHandler

    Callback when this, or another collider triggers a contact force event

    onIntersectionEnter?: IntersectionEnterHandler

    Callback when this collider, or another collider starts intersecting, and at least one of them is a sensor.

    onIntersectionExit?: IntersectionExitHandler

    Callback when this, or another collider stops intersecting, and at least one of them is a sensor.

    onSleep?: () => void
    onSubmerged?: (depth: number) => void

    Callback fired when the object enters or changes depth in water.

    onWake?: () => void
    position?:
        | number
        | Vector3
        | [x: number, y: number, z: number]
        | readonly [number, number, number]
        | Readonly<Vector3>

    Initial position of the RigidBody

    principalAngularInertia?: Vector3Tuple

    Principal angular inertia of this rigid body

    quaternion?:
        | Quaternion
        | [x: number, y: number, z: number, w: number]
        | readonly [number, number, number, number]
        | Readonly<Quaternion>

    The rotation, as a Quaternion, of this collider relative to the rigid body

    restitution?: number

    Set the restitution (bounciness) of auto-generated colliders. This does not affect any non-automatic child collider-components.

    restitutionCombineRule?: CoefficientCombineRule
    rotation?:
        | number
        | Euler
        | [x: number, y: number, z: number, order?: EulerOrder]
        | readonly [number, number, number, EulerOrder | undefined]
        | Readonly<Euler>

    Initial rotation of the RigidBody

    samplePoints?: [number, number, number][]

    Local offsets for sampling water depth. If omitted, a standard 8-point set is used.

    scale?:
        | number
        | Vector3
        | [x: number, y: number, z: number]
        | readonly [number, number, number]
        | Readonly<Vector3>

    The scale of this collider relative to the rigid body

    sensor?: boolean

    Sets whether or not this collider is a sensor.

    shape?: ColliderShape

    The shape of your collider

    softCcdPrediction?: number

    The maximum prediction distance Soft Continuous Collision-Detection.

    When set to 0, soft-CCD is disabled.

    Soft-CCD helps prevent tunneling especially of slow-but-thin to moderately fast objects. The soft CCD prediction distance indicates how far in the object’s path the CCD algorithm is allowed to inspect. Large values can impact performance badly by increasing the work needed from the broad-phase.

    It is a generally cheaper variant of regular CCD since it relies on predictive constraints instead of shape-cast and substeps.

    0
    
    solverGroups?: number

    The default solver groups bitmask for all colliders in this rigid body. Can be customized per-collider.

    type?: RigidBodyTypeString

    Specify the type of this rigid body

    userData?: Record<string, any> | Readonly<Record<string, any> | undefined>

    Passed down to the object3d representing this collider.