gg/gx/collider.go

30 lines
713 B
Go
Raw Normal View History

package gx
// Implementing the interface lets
// the engine to work faster about
// collisions because it first checks
// if the the bigger collider that
// contain more complicated structure
// do collide.
type ColliderSimplifier interface {
2023-05-22 23:39:01 +03:00
ColliderSimplify() Triangle
}
// The structure represents all
2023-05-22 23:39:01 +03:00
// information on collisions.
type Collision struct {
2023-05-22 23:39:01 +03:00
Current, With any
}
2023-05-22 23:39:01 +03:00
// Implementing the interface lets the engine
// to determine if the object collides with anything.
// Mostly will use the Collide function with some
// inner structure field as first argument.
// The Collide method will be called on collisions.
type Collider interface {
Collides(Collider) *Collision
Collide(*Collision)
}
2023-05-22 23:39:01 +03:00