Documentation
¶
Overview ¶
Holds physics-related properties of a surface, namely its roughness and bounciness. This class is used to apply these properties to a physics body.
Index ¶
- type Advanced
- type Any
- type Extension
- type ID
- type Instance
- func (self Instance) Absorbent() bool
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsPhysicsMaterial() Instance
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsResource() Resource.Instance
- func (self Instance) Bounce() Float.X
- func (self Instance) Friction() Float.X
- func (self Instance) ID() ID
- func (self Instance) Rough() bool
- func (self Instance) SetAbsorbent(value bool)
- func (self Instance) SetBounce(value Float.X)
- func (self Instance) SetFriction(value Float.X)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetRough(value bool)
- func (self Instance) Virtual(name string) reflect.Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsPhysicsMaterial ¶
func (*Extension[T]) AsRefCounted ¶
func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
func (*Extension[T]) AsResource ¶
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
type Instance [1]gdclass.PhysicsMaterial
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) Absorbent ¶
If true, subtracts the bounciness from the colliding object's bounciness instead of adding it.
func (Instance) AsPhysicsMaterial ¶
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsResource ¶
func (Instance) Bounce ¶
The body's bounciness. Values range from 0 (no bounce) to 1 (full bounciness).
Note: Even with Bounce set to 1.0, some energy will be lost over time due to linear and angular damping. To have a physics body that preserves all its energy over time, set Bounce to 1.0, the body's linear damp mode to Replace (if applicable), its linear damp to 0.0, its angular damp mode to Replace (if applicable), and its angular damp to 0.0.
func (Instance) Friction ¶
The body's friction. Values range from 0 (frictionless) to 1 (maximum friction).
func (Instance) Rough ¶
If true, the physics engine will use the friction of the object marked as "rough" when two objects collide. If false, the physics engine will use the lowest friction of all colliding objects instead. If true for both colliding objects, the physics engine will use the highest friction.
func (Instance) SetAbsorbent ¶
SetAbsorbent sets the property returned by [IsAbsorbent].
func (Instance) SetFriction ¶
SetFriction sets the property returned by [GetFriction].