crashcat docs
    Preparing search index...

    Type Alias ConeConstraint

    ConeConstraint: ConstraintBase & {
        angleConstraintPart: AngleConstraintPart;
        cosHalfConeAngle: number;
        cosTheta: number;
        localSpacePosition1: Vec3;
        localSpacePosition2: Vec3;
        localSpaceTwistAxis1: Vec3;
        localSpaceTwistAxis2: Vec3;
        pointConstraintPart: PointConstraintPart;
        worldSpaceRotationAxis: Vec3;
    }

    Cone constraint constrains 2 bodies to a single point and limits the swing between twist axes within a cone.

    Constraint: t1 · t2 >= cos(θ)

    Where:

    • t1 = twist axis of body 1 (world space)
    • t2 = twist axis of body 2 (world space)
    • θ = half cone angle (angle from principal axis of cone to edge)

    This removes 3 translation DOF (point constraint) and limits rotation to a cone (1 DOF limit). Note: Unlike SwingTwistConstraint, this does NOT constrain twist rotation around the axis.

    Type Declaration

    • angleConstraintPart: AngleConstraintPart

      angle constraint for cone limit (1 DOF)

    • cosHalfConeAngle: number

      cosine of half cone angle (cos(θ)) - constraint active when t1·t2 < cosHalfConeAngle

    • cosTheta: number

      current cosine of angle between twist axes (t1 · t2)

    • localSpacePosition1: Vec3

      attachment point on body 1 in local space

    • localSpacePosition2: Vec3

      attachment point on body 2 in local space

    • localSpaceTwistAxis1: Vec3

      twist axis on body 1 in local space (normalized)

    • localSpaceTwistAxis2: Vec3

      twist axis on body 2 in local space (normalized)

    • pointConstraintPart: PointConstraintPart

      point constraint for translation (3 DOF)

    • worldSpaceRotationAxis: Vec3

      world space rotation axis (t2 × t1, normalized) for angular constraint