Temp update to remove use of MakeFullWrapper for reducing redundant CPU time in profiling.

This commit is contained in:
genxium
2023-02-16 08:17:50 +08:00
parent 9dff989e02
commit fb42533f55
15 changed files with 7661 additions and 170 deletions

View File

@@ -48,6 +48,18 @@ func NewObject(x, y, w, h float64, tags ...string) *Object {
return o
}
func (obj *Object) GetData() interface{} {
return obj.Data
}
func (obj *Object) GetShape() *Shape {
return &(obj.Shape)
}
func (obj *Object) Position() (float64, float64) {
return obj.X, obj.Y
}
// Clone clones the Object with its properties into another Object. It also clones the Object's Shape (if it has one).
func (obj *Object) Clone() *Object {
newObj := NewObject(obj.X, obj.Y, obj.W, obj.H, obj.Tags()...)

View File

@@ -134,3 +134,15 @@ func (rb *RingBuffer) Clear() {
rb.StFrameId = 0
rb.EdFrameId = 0
}
func (rb *RingBuffer) GetStFrameId() int32 {
return rb.StFrameId
}
func (rb *RingBuffer) GetEdFrameId() int32 {
return rb.EdFrameId
}
func (rb *RingBuffer) GetCnt() int32 {
return rb.Cnt
}

View File

@@ -331,6 +331,10 @@ func (polygon *ConvexPolygon) PointInside(point Vector) bool {
return contactCount == 1
}
func (polygon *ConvexPolygon) GetPoints() []Vector {
return polygon.Points
}
type ContactSet struct {
Points []Vector // Slice of Points indicating contact between the two Shapes.
MTV Vector // Minimum Translation Vector; this is the vector to move a Shape on to move it outside of its contacting Shape.