Difference between revisions of "Body:setMass"
m (1 revision: Imported docs from potato.) |
|||
Line 1: | Line 1: | ||
+ | Sets the mass properties directly. | ||
+ | |||
+ | If you're not sure what all this stuff means, you can use [[Body:setMassFromShapes]] after adding shapes instead. | ||
+ | |||
+ | |||
+ | The first two parameters will be the local coordinates of the Body's [http://en.wikipedia.org/wiki/Center_of_mass center of mass]. | ||
+ | |||
+ | |||
+ | The third parameter is the mass, in kilograms. | ||
+ | |||
+ | |||
+ | The last parameter is the [http://en.wikipedia.org/wiki/Moment_of_inertia rotational inertia]. | ||
== Function == | == Function == | ||
Line 16: | Line 28: | ||
* [[parent::Body]] | * [[parent::Body]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
− | {{#set:Description=}} | + | {{#set:Description=Sets the mass properties directly. |
+ | }} |
Revision as of 16:17, 14 February 2010
Sets the mass properties directly.
If you're not sure what all this stuff means, you can use Body:setMassFromShapes after adding shapes instead.
The first two parameters will be the local coordinates of the Body's center of mass.
The third parameter is the mass, in kilograms.
The last parameter is the rotational inertia.
Function
Synopsis
Body:setMass( x, y, m, i )
Arguments
number x
- The x-component of the center of mass in local coordinates.
number y
- The y-component of the center of mass in local coordinates.
number m
- The mass, in kilograms.
number i
- The rotational inertia, in kilograms per squared meter.
Returns
Nothing.