Comments (4)
Hello!
I do not understand the problem.
Could you show some code as an example?
With a test case we can fix either the code or the doc message.
Thank you!
from collision2d.
Sure.
package main
import (
"fmt"
"github.com/Tarliton/collision2d"
)
func main(){
box1:=collision2d.NewBox(collision2d.Vector{X:0,Y:0},16,16)
polygon1:=box1.ToPolygon()
fmt.Println(polygon1)
}
The output is:
{Pos:{X:0.000000, Y:0.000000}
Offset:{X:0.000000, Y:0.000000}
Angle: 0.000000
Points: [{X:0.000000, Y:0.000000}
{X:16.000000, Y:0.000000}
{X:16.000000, Y:16.000000}
{X:0.000000, Y:16.000000}
]
CalcPoints: [{X:0.000000, Y:0.000000}
{X:16.000000, Y:0.000000}
{X:16.000000, Y:16.000000}
{X:0.000000, Y:16.000000}
]}
So the points show 0,0 in the top left corner. Instead of 0,0 being the center.
from collision2d.
You know I keep saying top left when really it's bottom left. I'm used to dealing with screens where 0,0 is the top left corner, and max width and height are the bottom right corner.
from collision2d.
The problem is here.
It should use center to calculate those corners.
from collision2d.
Related Issues (2)
- circular sector HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from collision2d.