camera
gamnit :: CameraAnchor :: _relative_x
X position as proportion of the screen widthgamnit :: CameraAnchor :: _relative_y
Y position as proportion of the screen heightgamnit :: CameraAnchor :: defaultinit
gamnit :: CameraAnchor :: relative_x
X position as proportion of the screen widthgamnit :: CameraAnchor :: relative_x=
X position as proportion of the screen widthgamnit :: CameraAnchor :: relative_y
Y position as proportion of the screen heightgamnit :: CameraAnchor :: relative_y=
Y position as proportion of the screen heightgamnit $ CameraAnchor :: SELF
Type of this instance, automatically specialized in every classgamnit :: CameraAnchor :: _relative_x
X position as proportion of the screen widthgamnit :: CameraAnchor :: _relative_y
Y position as proportion of the screen heightserialization :: Serializable :: accept_inspect_serializer_core
serialization :: Serializable :: accept_json_serializer
Refinable service to customize the serialization of this class to JSONserialization :: Serializable :: accept_msgpack_attribute_counter
Hook to customize the behavior of theAttributeCounter
serialization :: Serializable :: accept_msgpack_serializer
Hook to customize the serialization of this class to MessagePackserialization :: Serializable :: add_to_bundle
Called by[]=
to dynamically choose the appropriate method according
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
serialization :: Serializable :: core_serialize_to
Actual serialization ofself
to serializer
geometry :: Boxed3d :: defaultinit
geometry :: Boxed :: defaultinit
gamnit :: CameraAnchor :: defaultinit
geometry :: IPoint :: defaultinit
core :: Object :: defaultinit
geometry :: IPoint3d :: defaultinit
geometry :: IPoint :: dist2_with_2d
geometry :: IPoint :: dist2_with_3d
serialization :: Serializable :: from_deserializer
Create an instance of this class from thedeserializer
geometry :: Boxed :: intersects
Doesself
intersect with other
?
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.
serialization :: Serializable :: msgpack_extra_array_items
Hook to request a larger than usual metadata arraycore :: 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).gamnit :: CameraAnchor :: relative_x
X position as proportion of the screen widthgamnit :: CameraAnchor :: relative_x=
X position as proportion of the screen widthgamnit :: CameraAnchor :: relative_y
Y position as proportion of the screen heightgamnit :: CameraAnchor :: relative_y=
Y position as proportion of the screen heightserialization :: Serializable :: serialize_msgpack
Serializeself
to MessagePack bytes
serialization :: Serializable :: serialize_to
Serializeself
to serializer
serialization :: Serializable :: serialize_to_json
Serializeself
to JSON
serialization :: Serializable :: serialize_to_or_delay
Accept references or force direct serialization (usingserialize_to
)
serialization :: Serializable :: to_pretty_json
Serializeself
to plain pretty JSON
Serializer::serialize
# Immutable relative anchors for reference points on `camera`
private class CameraAnchor
super IPoint3d[Float]
# Reference camera
var camera: UICamera
# Reference position, the top left of the screen
var ref: Point3d[Float] = camera.position is lazy
# X position as proportion of the screen width
var relative_x: Float
# Y position as proportion of the screen height
var relative_y: Float
redef fun x do return ref.x + relative_x*camera.width
redef fun y do return ref.y + relative_y*camera.height
redef fun z do return ref.z
redef fun offset(x, y, z) do return new OffsetPoint3d(self, x.to_f, y.to_f, z.to_f)
end
lib/gamnit/cameras.nit:279,1--300,3