Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / RayCasting and Sprite Shape Boxes

Author
Message
greycheek
8
Years of Service
User Offline
Joined: 13th Mar 2016
Location:
Posted: 19th Mar 2018 23:57
In my game there is a map with a number of trees that get checked with a physics ray cast. The trees are not sprites, but are represented by a single dummy sprite, and AddSpriteShapeBox is used to add each tree shape to the dummy sprite. I have two questions:

1 Does a dummy sprite have any default shape or no shape?
2 The documentation says: "If you do not need to know what has hit your hidden shapes then you can add them all to a single dummy sprite using the AddSpriteShape commands for best performance." Does this mean that ray casting will not work with hidden shapes?
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 20th Mar 2018 21:45
Quote: "Does this mean that ray casting will not work with hidden shapes?"
No, it just means you can add all your physics shapes to one dummy sprite instead of having lots of separate dummy sprites. You'll only get back one sprite ID for any collisions but if that doesn't matter in your game, then it will provide better performance over lots of separate dummy sprites.

Login to post a reply

Server time is: 2024-03-28 21:09:18
Your offset time is: 2024-03-28 21:09:18