Future Perfect

Future Perfect

Not enough ratings
Coord System Indicator
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
525.262 KB
2 Feb, 2015 @ 3:32pm
27 Apr, 2015 @ 2:13pm
9 Change Notes ( view )

Subscribe to download
Coord System Indicator

Description
A library and some models to show coordinate systems, vectors and points for debugging purposes.

quick documentation:
-- what you need:
indicator = require("coord_system_indicator/indicator_lib.lua")
position = Vec3(0,0,0)
direction = Vec3(1,0,0) -- if direction is Vec3(0, 0, 0), nothing will be shown
coords = Coords.GetIdentity() -- should be a valid Coords object
name = 42 -- name can be either a number or a string. if name is nil, 0 will be used
name = "someName"

-- how to show things: call multiple times with the same name to update positions/directions
-- Points: shows a point (sphere) at position
indicator.ShowPoint(position, name) -- for each name a new point is added
indicator.ShowPoint(position) -- equal to ShowPoint(position, 0)
indicator.ShowPoint() -- equal to ShowCoords(Self_GetCoords().origin)
indicator.ShowPoint(position, name, showName) -- shows name when showName=true

-- Vectors: shows a vector (arrow) at position pointing in direction
indicator.ShowVector(direction, position, name) -- for each name a new vector is added
indicator.ShowVector(direction, position) -- equal to ShowVector(direction, position, 0)
indicator.ShowVector(direction) -- equal to ShowVector(direction, Self_GetCoords().origin)
indicator.ShowVector() -- equal to ShowVector(Self_GetCoords().yAxis)
indicator.ShowVector(direction, position, name, showName) -- shows name when showName=true

-- Coords: shows a coordinate system (3 axes)
indicator.ShowCoords(coords, name) -- for each name a new coords is added
indicator.ShowCoords(coords) -- equal to ShowCoords(coords, 0)
indicator.ShowCoords() -- equal to ShowCoords(Self_GetCoords())
indicator.ShowCoords(coords, name, showName) -- shows name when showName=true

-- how to hide things:
indicator.HideAll() -- removes visibility
indicator.UnhideAll() -- restores visibility

-- how to delete things:
indicator.DeletePoint(name)
indicator.DeletePoint() -- equal to DeletePoint(0)
indicator.DeleteVector(name)
indicator.DeleteVector() -- equal to DeletePoint(0)
indicator.DeleteCoords(name)
indicator.DeleteCoords() -- equal to DeleteCoords(0)
indicator.DeleteAllPoints()
indicator.DeleteAllVectors()
indicator.DeleteAllCoords()
indicator.DeleteAll() -- it's a good idea to call this in the OnDestroy() method