www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: quixote_arg on January 18, 2006, 08:59:22 pm

Title: Sphere collision and radius
Post by: quixote_arg on January 18, 2006, 08:59:22 pm
Hi, I have a question.

I've created an sphere Object3D with the Primitives class. Something like:

Code: [Select]
Object3D bullet = Primitives.getSphere(0.5f);

When I want to try collision of that object, naturally the checkForCollisionSpherical method seems to be the most appropiate.

However: the checkForCollisionSpherical takes a float as a radius but the getSphere method of the Primitives class takes a float with the scale of the sphere.

How are these two values related with each other?

I mean: what is the radius for a sphere created with Primitives in order to make the collision sphere optimal?

Thanks
Title: Re: Sphere collision and radius
Post by: EgonOlsen on January 18, 2006, 09:46:16 pm
Quote from: "quixote_arg"

How are these two values related with each other?

I mean: what is the radius for a sphere created with Primitives in order to make the collision sphere optimal?
They should correlate, i.e. a scale of 5 should result in a radius of 5 for the collision detection.