love.physics (简体中文)

能模拟2D严格的物体物理特性以现实的方式。这个模块基于Box2D, 并且这个API尽可能严格的符合Box2D API

O.png love.physics不是轻量级的, 甚至不是简单易用的. 这是个十吨重的垂子用于重物提升(额。。。锤子。。。提升??)

如果你仅仅需要制造一个角色跳跃过阻碍或者类似,那么请走开,不要看这里。

 


类型

BodyBodies are objects with velocity and position.
ContactContacts are objects created to manage collisions in worlds.
JointAttach multiple bodies together to interact in unique ways.
ShapeShapes are objects used to control mass and collisions.
WorldA world is an object that contains all bodies and joints.

Functions

love.physics.newBodyCreates a new body.
love.physics.newCircleShapeCreates a new CircleShape.
love.physics.newDistanceJointCreates a DistanceJoint between two bodies.
love.physics.newGearJointCreate a GearJoint connecting two Joints.
love.physics.newMouseJointCreate a joint between a body and the mouse.
love.physics.newPolygonShapeCreates a new PolygonShape.
love.physics.newPrismaticJointCreates a PrismaticJoint between two bodies.
love.physics.newPulleyJointCreates a PulleyJoint to join two bodies to each other and the ground.
love.physics.newRectangleShapeShorthand for creating rectangular PolygonShapes.
love.physics.newRevoluteJointCreates a pivot joint between two bodies.
love.physics.newWorldCreates a new World.

See Also


Other Languages