Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement RayCast #11

Open
yderidde opened this issue Feb 15, 2012 · 10 comments
Open

Implement RayCast #11

yderidde opened this issue Feb 15, 2012 · 10 comments

Comments

@yderidde
Copy link

I saw in the codebase that RayCast is not implemented. Is there a chance you implement it ?

Here the snippet from b2Fixture:
/// Cast a ray against this shape.
/// @param output the ray-cast results.
/// @param input the ray-cast input parameters.
/// void RayCast(b2RayCastOutput* output, const b2RayCastInput& input) const;
public function RayCast():void {
/// NOT IMPLEMENTED.
}

@jesses
Copy link
Owner

jesses commented Feb 15, 2012

You could probably just use the b2World RayCast and check if that shape is in the results for now. Waiting until the new Adobe Alchemy comes out before I make any big changes.

@yderidde
Copy link
Author

I would need a b2RayCastOutput with the calculated fraction etc ... which is not what the RayCast in b2World provide so this is not an alternative for me i'm afraid :(

Considering that you know pretty well your code. I'm wondering why you didn't implement RayCast in b2Fixture ? is there a show-stopper or some kind of complexity that prevented you to implement it ?

@jesses
Copy link
Owner

jesses commented Feb 15, 2012

You do get the fraction with the b2World::RayCast. It's passed into the raycast callback function.

Can't remember why I didn't implement it. Must've been a difficult function that I didn't think was worth the effort. No one has asked for it before now...

@yderidde
Copy link
Author

Ok i will try with the b2World RayCast function but before that I have a very nasty issue and not sure at all where it comes from .. it is probably not the best place to discuss about it here but while I have you I will tell you :)

I'm getting an RTE when creating a b2Fixture from a shape or from the body. Here the stack:
TypeError: Error #1006: value is not a function.
at cmodule.Box2D::FSM__Z20b2Body_CreateFixturePvP8_AS3_Val/work()
at Function/()
at Function/()
at Box2DAS.Dynamics::b2Fixture()[/Developer/Repositories/app/app-client/src/main/air/Box2DAS/Dynamics/b2Fixture.as:25]
at Box2DAS.Collision.Shapes::b2Shape/create()[/Developer/Repositories/app/app-client/src/main/air/Box2DAS/Collision/Shapes/b2Shape.as:26]

Maybe we can take this one offline if you are ok with helping me figuring out what can it be :)

@jesses
Copy link
Owner

jesses commented Feb 15, 2012

Can you post this to the Box2D WCK forums? I check that more than github. Please post the part of your code that results in that error. The forums are here:

http://box2d.org/forum/viewforum.php?f=19

@yderidde
Copy link
Author

@yderidde
Copy link
Author

Jesses, can you please have a look at the thread here http://box2d.org/forum/viewtopic.php?f=19&t=8178
Would like to have your input on it. Thanks in advance. :)

@jesses
Copy link
Owner

jesses commented Feb 16, 2012

Can't figure it out at first glance I'll take a look when I get some free time, probably this weekend.

@yderidde
Copy link
Author

thanks for this !

@jesses
Copy link
Owner

jesses commented Feb 18, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants