WhenDoes Java have a built-in Vector class suitable for handling collision detection / response and you need a Vector class, do you need to create that class yourself or is there a java class you can use?
A vector class It should have methods like: subtract(Vector v)
, normalize()
, dotProduct(Vector v)
, ...
At the moment itIt seems logical to use classes like java.awt.Rectangle
and java.awt.Polygon
to calculate collisions. Would I be right to use these classes for this purpose?
My question is not about how to implement collision detection, I know how that works. Howeverunderstand collision detection; I'm only wondering what would be a correct and clean wayapproach to implement it is idiomatic in java sinceJava. I'm fairly new to the language and to application development in general.