Difference between revisions of "Body:setMass"
(0.8.0 related stuff.) |
m |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
Sets a new body mass. | Sets a new body mass. | ||
− | |||
− | |||
== Function == | == Function == | ||
+ | {{newin|[[0.8.0]]|080|type=variant}} | ||
=== Synopsis === | === Synopsis === | ||
<source lang="lua"> | <source lang="lua"> | ||
− | + | body:setMass( mass ) | |
</source> | </source> | ||
=== Arguments === | === Arguments === | ||
Line 14: | Line 12: | ||
Nothing. | Nothing. | ||
− | + | == Function == | |
− | |||
{{oldin|[[0.8.0]]|080|type=variant}} | {{oldin|[[0.8.0]]|080|type=variant}} | ||
Sets the mass properties directly. | Sets the mass properties directly. | ||
If you're not sure what all this stuff means, you can use [[Body:setMassFromShapes]] after adding shapes instead. | 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 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 third parameter is the mass, in kilograms. | ||
− | |||
The last parameter is the [http://en.wikipedia.org/wiki/Moment_of_inertia rotational inertia]. | The last parameter is the [http://en.wikipedia.org/wiki/Moment_of_inertia rotational inertia]. | ||
− | |||
− | |||
=== Synopsis === | === Synopsis === | ||
<source lang="lua"> | <source lang="lua"> | ||
− | + | body:setMass( x, y, m, i ) | |
</source> | </source> | ||
=== Arguments === | === Arguments === |
Latest revision as of 07:21, 12 October 2016
Sets a new body mass.
Contents
Function
Available since LÖVE 0.8.0 |
This variant is not supported in earlier versions. |
Synopsis
body:setMass( mass )
Arguments
number mass
- The mass, in kilograms.
Returns
Nothing.
Function
Removed in LÖVE 0.8.0 |
This variant is not supported in that and later versions. |
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.
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.
See Also
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info