Sign in

    moui_3d_physics

    Neutral 3D physics contracts for MoUI

    moui
    3d
    physics
    rapier
    Download zip
    Author
    Version
    0.2.1
    License
    Apache-2.0
    Last updated
    5 days ago
    Downloads
    12

    Dependencies

    wzzc-dev/moui_3d_physics does not have a README file

    BodyDesc

    pub(all) struct BodyDesc {
    body_type : BodyType
    position :
    Vec3

    rotation :
    Quat

    gravity_scale : Double
    } derive(Eq, ToJson,
    Debug
    )

    BodyDesc::body_type

    fn BodyDesc::body_type(self : BodyDesc) -> BodyType

    BodyDesc::equal

    fn BodyDesc::equal(BodyDesc, BodyDesc) -> Bool

    BodyDesc::gravity_scale

    fn BodyDesc::gravity_scale(self : BodyDesc) -> Double

    BodyDesc::new

    fn BodyDesc::new(body_type? : BodyType, position? :
    Vec3
    , rotation? :
    Quat
    , gravity_scale? : Double) -> BodyDesc

    BodyDesc::not_equal

    fn BodyDesc::not_equal(x : BodyDesc, y : BodyDesc) -> Bool

    BodyDesc::position

    BodyDesc::rotation

    BodyDesc::to_json

    fn BodyDesc::to_json(BodyDesc) -> Json

    BodyDesc::to_repr

    BodyId

    pub(all) struct BodyId {
    value : Int64
    } derive(Eq, Hash, ToJson,
    Debug
    )

    BodyId::equal

    fn BodyId::equal(BodyId, BodyId) -> Bool

    BodyId::hash

    fn BodyId::hash(self : BodyId) -> Int

    BodyId::hash_combine

    fn BodyId::hash_combine(BodyId, Hasher) -> Unit

    BodyId::new

    fn BodyId::new(value : Int64) -> BodyId

    BodyId::not_equal

    fn BodyId::not_equal(x : BodyId, y : BodyId) -> Bool

    BodyId::to_json

    fn BodyId::to_json(BodyId) -> Json

    BodyId::to_repr

    BodyId::value

    fn BodyId::value(self : BodyId) -> Int64

    BodyType

    pub(all) enum BodyType {
    Dynamic
    Fixed
    Kinematic
    } derive(Eq, ToJson,
    Debug
    )

    BodyType::equal

    fn BodyType::equal(BodyType, BodyType) -> Bool

    BodyType::not_equal

    fn BodyType::not_equal(x : BodyType, y : BodyType) -> Bool

    BodyType::to_json

    fn BodyType::to_json(BodyType) -> Json

    BodyType::to_repr

    ColliderDesc

    pub(all) struct ColliderDesc {
    shape : Shape
    body : BodyId?
    sensor : Bool
    friction : Double
    restitution : Double
    } derive(Eq, ToJson,
    Debug
    )

    ColliderDesc::body

    fn ColliderDesc::body(self : ColliderDesc) -> BodyId?

    ColliderDesc::equal

    ColliderDesc::friction

    fn ColliderDesc::friction(self : ColliderDesc) -> Double

    ColliderDesc::new

    fn ColliderDesc::new(shape~ : Shape, body? : BodyId?, sensor? : Bool, friction? : Double, restitution? : Double) -> ColliderDesc

    ColliderDesc::not_equal

    fn ColliderDesc::not_equal(x : ColliderDesc, y : ColliderDesc) -> Bool

    ColliderDesc::restitution

    fn ColliderDesc::restitution(self : ColliderDesc) -> Double

    ColliderDesc::sensor

    fn ColliderDesc::sensor(self : ColliderDesc) -> Bool

    ColliderDesc::shape

    fn ColliderDesc::shape(self : ColliderDesc) -> Shape

    ColliderDesc::to_json

    ColliderId

    pub(all) struct ColliderId {
    value : Int64
    } derive(Eq, Hash, ToJson,
    Debug
    )

    ColliderId::equal

    fn ColliderId::equal(ColliderId, ColliderId) -> Bool

    ColliderId::hash

    fn ColliderId::hash(self : ColliderId) -> Int

    ColliderId::hash_combine

    fn ColliderId::hash_combine(ColliderId, Hasher) -> Unit

    ColliderId::new

    fn ColliderId::new(value : Int64) -> ColliderId

    ColliderId::not_equal

    fn ColliderId::not_equal(x : ColliderId, y : ColliderId) -> Bool

    ColliderId::to_json

    fn ColliderId::to_json(ColliderId) -> Json

    ColliderId::value

    fn ColliderId::value(self : ColliderId) -> Int64

    PhysicsWorld

    pub(all) struct PhysicsWorld {
    gravity :
    Vec3

    next_body : Int64
    next_collider : Int64
    bodies : Map[BodyId, BodyDesc]
    colliders : Map[ColliderId, ColliderDesc]
    } derive(
    Debug
    )

    PhysicsWorld::body

    fn PhysicsWorld::body(self : PhysicsWorld, id : BodyId) -> BodyDesc?

    PhysicsWorld::collider

    fn PhysicsWorld::collider(self : PhysicsWorld, id : ColliderId) -> ColliderDesc?

    PhysicsWorld::create_body

    fn PhysicsWorld::create_body(self : PhysicsWorld, desc : BodyDesc) -> BodyId

    PhysicsWorld::create_collider

    fn PhysicsWorld::create_collider(self : PhysicsWorld, desc : ColliderDesc) -> ColliderId

    PhysicsWorld::gravity

    PhysicsWorld::new

    PhysicsWorld::step

    fn PhysicsWorld::step(self : PhysicsWorld, delta_seconds : Double) -> Int

    Backend hook. The neutral world does not guess physics; an adapter owns the actual integration and returns a deterministic step count.

    RayHit

    pub(all) struct RayHit {
    collider : ColliderId
    distance : Double
    position :
    Vec3

    normal :
    Vec3

    } derive(
    Debug
    )

    RayHit::collider

    fn RayHit::collider(self : RayHit) -> ColliderId

    RayHit::distance

    fn RayHit::distance(self : RayHit) -> Double

    RayHit::new

    fn RayHit::new(collider~ : ColliderId, distance~ : Double, position~ :
    Vec3
    , normal~ :
    Vec3
    ) -> RayHit

    RayHit::normal

    RayHit::position

    fn RayHit::position(self : RayHit) ->
    Vec3

    RayHit::to_repr

    Shape

    pub(all) enum Shape {
    Ball(Double)
    Cuboid(
    Vec3
    )
    CapsuleX(Double, Double)
    CapsuleY(Double, Double)
    CapsuleZ(Double, Double)
    Triangle(
    Vec3
    ,
    Vec3
    ,
    Vec3
    )
    Trimesh(Array[
    Vec3
    ], Array[(Int, Int, Int)])
    } derive(Eq, ToJson,
    Debug
    )

    Shape::equal

    fn Shape::equal(Shape, Shape) -> Bool

    Shape::not_equal

    fn Shape::not_equal(x : Shape, y : Shape) -> Bool

    Shape::to_json

    fn Shape::to_json(Shape) -> Json

    Shape::to_repr

    Source Files

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io