Documentation ¶
Index ¶
- func FloatToVec(out []glm.Vector2, in ...float32) []glm.Vector2
- func MinMaxVec(a, b glm.Vector2) (min glm.Vector2, max glm.Vector2)
- func VecToFloat(out []float32, in ...glm.Vector2) []float32
- type AABB
- type Body
- type DebugDraw
- type FrameData
- type Shape
- func (s *Shape) AABB() AABB
- func (s *Shape) Clone() *Shape
- func (s *Shape) Origin() glm.Vector2
- func (s *Shape) Position() glm.Vector2
- func (s *Shape) Rotation() float32
- func (s *Shape) Scale() glm.Vector2
- func (s *Shape) SetOrigin(origin glm.Vector2)
- func (s *Shape) SetPosition(pos glm.Vector2)
- func (s *Shape) SetRotation(rot float32)
- func (s *Shape) SetScale(scale glm.Vector2)
- func (s *Shape) String() string
- func (s *Shape) TransformedVertices() []float32
- func (s *Shape) Translate(transf glm.Vector2)
- func (s *Shape) Vertices() []float32
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AABB ¶
A axis-aligned bounding box
type Body ¶
type Body struct {
// contains filtered or unexported fields
}
Body is a collection of shapes that have their vertices kept in a solid formation
Ie, Body is a RigidBody
type DebugDraw ¶
type DebugDraw interface { // BeginFrame is called to signal the start of a new frame BeginFrame(frame FrameData) // EndFrame is called to signal the end of the last frame EndFrame(frame FrameData) // DrawShape should the given shape // // If velocity != 0 the shape is moving // If accel != 0 the shape is moving and accelerating // If mass != 0 the shape is solid DrawShape(s *Shape, mass, velocity, accel float32) }
DebugDraw group a small number of functions used by the figo engine to give a visual representation of the world at the given state
type FrameData ¶
type FrameData struct { // The fixed delta used in the engine FixedDelta float32 // The time elapsed from the last frame Delta float32 // The number of this frame Number uint // Half of the world width HalfWidth float32 // Half of the world height HalfHeight float32 }
Hold information to identify the given frame
type Shape ¶
type Shape struct {
// contains filtered or unexported fields
}
func NewPolygonShape ¶
NewPolygonShape will copy all vertices from points to this shape.
func NewRectShape ¶
NewRectShape create a new Shape and In this function you should provide half of the final size, if you give (1,1) you get a box of (2,2).
X and Y don't need to be equal
Vertex information is set clockwise.
func (*Shape) SetPosition ¶
func (*Shape) SetRotation ¶
func (*Shape) TransformedVertices ¶
Click to show internal directories.
Click to hide internal directories.