x, y, z
, u, v, z
or r, g, b
gamnit :: Vec3 :: defaultinit
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
core :: Object :: defaultinit
gamnit :: Vec3 :: defaultinit
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: native_class_name
The class name of the object in CString format.core :: Object :: output_class_name
Display class name on stdout (debug only).
# Vector of 3 values, either `x, y, z`, `u, v, z` or `r, g, b`
class Vec3
# X value
var x = 0.0 is writable
# Y value
var y = 0.0 is writable
# Z value
var z = 0.0 is writable
# U value (redirection as `x`)
fun u: Float do return x
# Set U value (redirection for `x=`)
fun u=(value: Float) do x = value
# V value (redirection as `y`)
fun v: Float do return y
# Set V value (redirection for `y=`)
fun v=(value: Float) do y = value
# R value
fun r: Float do return x
# Set R value (redirection for `x=`)
fun r=(value: Float) do x = value
# G value
fun g: Float do return y
# Set G value (redirection for `y=`)
fun g=(value: Float) do y = value
# B value
fun b: Float do return z
# Set B value (redirection for `z=`)
fun b=(value: Float) do z = value
# Return all values into a new `Array[Float]`
fun to_a: Array[Float] do return [x, y, z]
redef fun to_s do return "<{class_name} {x} {y} {z}>"
end
lib/gamnit/model_parsers/model_parser_base.nit:20,1--66,3