x, y, z, w
, u, v, z, w
or r, g, b, a
gamnit :: Vec4 :: defaultinit
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
gamnit :: Vec4 :: defaultinit
gamnit :: Vec3 :: defaultinit
core :: Object :: 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 :: output_class_name
Display class name on stdout (debug only).
# Vector of 4 values, either `x, y, z, w`, `u, v, z, w` or `r, g, b, a`
class Vec4
super Vec3
# W value
var w = 1.0 is writable
# A value (redirection to `z`)
fun a: Float do return z
# Set A value (redirection for `z=`)
fun a=(value: Float) do z = value
# Return all values into a new `Array[Float]`
redef fun to_a do return [x, y, z, w]
redef fun to_s do return "<{class_name} {x} {y} {z} {w}>"
end
lib/gamnit/model_parsers/model_parser_base.nit:68,1--85,3