Package | com.fileitup.fisixengine.materials |
Class | public final class MaterialFactory |
See also
Method | Defined by | ||
---|---|---|---|
addMaterial(name:String, friction:Number, bounce:Number, traction:Number = 1, color:int = -1):void
[static]Adds a material to be used in the simulation
| MaterialFactory | ||
getMaterial(name:String):Material
[static]This method is used internally by the engine to retrieve a reference
to a Material object by the given name
| MaterialFactory | ||
removeMaterial(name:String):void
[static]Removes the named material from the MaterialFactory
This does not affect objects which have already been assigned the material
| MaterialFactory |
addMaterial | () | method |
public static function addMaterial(name:String, friction:Number, bounce:Number, traction:Number = 1, color:int = -1):void
Adds a material to be used in the simulation
Parametersname:String — The name of the material, to be used when setting an object's material
|
|
friction:Number — The coefficient of friction of the object between 0 and 1.
0 represents no friction (ice-like) and 1 is full friction (very thick sandpaper perhaps) |
|
bounce:Number — A number between 0 and 1 that represents the coefficient of reinstitution.
0 represents an object which doesn't bounce (clay-like) and 1 would be a super rubber ball that never loses energy
|
|
traction:Number (default = 1 ) — A number between 0 and 1 that represents the traction of a wheel to a surface.
If the material is assigned to a surface, it will affect wheels' traction when colliding with it.If assigned to a wheel, the value affects the wheel's traction with everything else. 0 represents no traction (ice-like) and 1 represents full traction (a good very road surface) |
|
color:int (default = -1 ) — You may set this value to have the engine render any object with this material using a custom color
|
See also
getMaterial | () | method |
public static function getMaterial(name:String):Material
This method is used internally by the engine to retrieve a reference to a Material object by the given name
Parametersname:String |
Material |
removeMaterial | () | method |
public static function removeMaterial(name:String):void
Removes the named material from the MaterialFactory This does not affect objects which have already been assigned the material
Parametersname:String — name of the material when created using addMaterial()
|
See also