realbasic-games
[Top] [All Lists]

Re: Collision-Detection in SuperSpriteSurface

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: Collision-Detection in SuperSpriteSurface
From: John Balestrieri <mrjohn at tinrocket dot com>
Date: Fri, 26 Aug 2005 11:07:15 -0400
Delivered-to: realbasic-games at lists dot realsoftware dot com
References: <5A091C59-FEA8-490F-B1C1-C521AE15A17A at gmx dot de>
Hi Nils,

For number 1, the size of the image is used to automatically create a 'quick bounds' that is used for coarse collision detection. This is calculated as an axis-aligned square of the minimal enclosing circle of the image. So yes, if you bounds is larger than the image area, or fall way outside of it, it will not be checked. It is not a bug but a design decision. In order to tweak this value, you can do the following:

Whenever you move a sprite or update it's rotation or position, call:

    SuperSpriteSurface.Update

immediately after calling this function you can set the value of:

    SuperSpriteSurface.z_absoluteCullRadius = x

x being whatever you required the minimal bounding radius to be. Note: this property is an internal one. Unless directed to do so, you should not mess around with these methods and functions. In this case however, I'm explaining proper usage. This workaround should not be necessary in the next release of SSS -- I have been considering a public way of altering the the 'quick bounds' radius.

Again this value is used for pre-collision checking to quickly eliminate unnecessary, and sometimes expensive, collision checks.

For number 2, could you provide a sample project? Does the child sprite in question have it's own collision bounds? Has the group name of this bounds been 'registered' with the SuperSpriteSurface?

Thanks,

John



On Aug 26, 2005, at 7:11 AM, Nils Raschke wrote:

Hi all,

I'm experiencing some problems with SuperSpriteSurface an its collision-detection.

1) If a bound is very large and the image of a supersprite is very small collisions are only detected in a much smaller area inside the bound.

2) If I append a supersprite to a superspritegroup only the superspritegroup has collision detection, the appended supersprite is not detected...

I want to know if these are known problems or if there are any workarounds.

Greetings,
Nils
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>