Click or drag to resize

Physical Objects Creation 2D

2D Game EngineManual / Content Creation / Physical Objects Creation 2DBase Types

Physical Objects Creation 2D

NeoAxis Engine comes with a rich set of tools for working with 2D body physics.

Contents
Display physical objects

Physical objects are not displayed in the editor by default. In order to enable visualization, one needs to go to Scene Editor tab in Ribbon, and press Development Data, turn on Physical Objects checkbox.

Screenshot999999999863 2.png
Rigid Body 2D

For a nice overview of rigid bodies and constraints one can take a look at 'Physics rigid body 2D.scene' file, which can be found at 'Assets\Samples\Starter Content\Scenes'.

In order to run simulation, one should press Play button in Ribbon or in Quick Access Toolbar.

Screenshot999999999862.png

One can create Rigid Body 2D by picking required figure, and dropping in the scene.

Screenshot999999999866 2.png

Also, body settings can be modified. For example one can made body dynamical.

Screenshot999999999867 2.png

In addition to simple bodies, one can create compound rigid bodies. That can be achieved via placing additional shapes to the body.

Screenshot999999999868 2.png
Name Description
Motion Type The type of motion used.
Mass The mass of the rigidbody.
Inertia Gets or sets the rotational inertia of the body about the local origin.
Local Center Gets or sets the local position of the center of mass.
Enable Gravity Whether the rigidbody is affected by the gravity.
Linear Damping The linear reduction of velocity over time.
Angular Damping The angular reduction of velocity over time.
Fixed Rotation Whether the body to have fixed rotation.
Allow Sleep Allows sleep the body.
Include In Ccd Solver Gets or sets a value indicating whether this body should be included in the CCD solver.
Linear Velocity The initial linear velocity of the body.
Angular Velocity The initial angular velocity of the body.
Active Gets the sleep state of the body. A sleeping body has very low CPU cost.
Add Collision

Another way to create rigid body is to press Add Collision button in Ribbon or via context menu. This works best when one need to add physical body to existing object in the scene.

Screenshot999999999869.png

One can see that body now has nested object Collision Body, which could be tuned.

Screenshot999999999870 2.png
See also
2D Game EngineBase Types