What Java class should I use to represent a Vector?
Posted
by
user8363
on Game Development
See other posts from Game Development
or by user8363
Published on 2012-03-29T19:16:35Z
Indexed on
2014/06/04
15:47 UTC
Read the original article
Hit count: 211
Does Java have a built-in Vector class suitable for handling collision detection / response? It should have methods like subtract(Vector v)
, normalize()
, dotProduct(Vector v)
, ...
It seems logical to use java.awt.Rectangle
and java.awt.Polygon
to calculate collisions. Would I be right to use these classes for this purpose?
I understand collision detection; I'm only wondering what approach to it is idiomatic in Java. I'm new to the language and to application development in general.
© Game Development or respective owner