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.

Dark Physics & Dark A.I. & Dark Dynamix / [DarkPHYS] Dynamic Objects and Raycasts

Author
Message
entomophobiac
22
Years of Service
User Offline
Joined: 1st Nov 2002
Location: United States
Posted: 12th Apr 2010 14:16
I've been toying with raycasting and getting it to actually respond to any and all objects in a scene. But I can't get it to return data from collisions with dynamic objects.

Now, reading old posts here, I see that the raycasting commands have been allegedly broken since its release in 2005/2006. Have they still not been fixed?

If there's another solution to the raycasting, even one requiring (yet another) plugin, it would be much appreciated.
NickH
16
Years of Service
User Offline
Joined: 19th May 2008
Location: Nova Prospekt, North Yorks, UK
Posted: 12th Apr 2010 16:54 Edited at: 12th Apr 2010 16:57
I've used Sparkys collision for raycasting and DarkPhysics for collision physics. I'm also planning on using Sparkys for the external camera collision. Its almost bullet proof and I had a working laser sight going in a very short time considering I'd never used Sparkys before. It barely uses any resources either.
entomophobiac
22
Years of Service
User Offline
Joined: 1st Nov 2002
Location: United States
Posted: 12th Apr 2010 17:08
Sounds interesting. And I guess that would mean setting up an object's physics properties AND collision properties as it's loaded?
NickH
16
Years of Service
User Offline
Joined: 19th May 2008
Location: Nova Prospekt, North Yorks, UK
Posted: 12th Apr 2010 17:54 Edited at: 12th Apr 2010 18:02
Yeah, and you'll have to update each object per loop as well as the initial setup command, but its easy. Though only dynamic/ moving objects need updating. The thing is you can have an object setup in DarkPhysics as a convex for collision/ physics but have it setup as mesh in Sparkys so the ray cast is polygon perfect. This makes my vehicle work perfectly enough for collision and when I shine the laser sight on the chassis the laser point and beam go into all the details.

I'd suggest looking at a few of the examples when experimenting at first.
entomophobiac
22
Years of Service
User Offline
Joined: 1st Nov 2002
Location: United States
Posted: 13th Apr 2010 10:20
Wasn't that hard to implement, so I have it up and running now. Actually provided me with the right tools to add a few other features, as well, that I have been putting off for some time.

Great stuff. Funny that I already had it lying on my HDD.
NickH
16
Years of Service
User Offline
Joined: 19th May 2008
Location: Nova Prospekt, North Yorks, UK
Posted: 14th Apr 2010 00:11
Hehe yeah i had downloaded it once or twice in the past but never used it before recently either. I mean when I first got DarkPhysics I assumed I wouldn't it...and in a perfect world shouldn't need it I've used the raycasting for numerous cool things and have many more ideas for it. Its damn useful
Clonkex
Forum Vice President
14
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 22nd May 2010 03:11
You think raycasting is useful? Correction: EXTREMELY useful! I actually HAVE to have it because of the way my FPS game works:

1. ray cast down from cam and record hit pos (x,y, and z)
2. if b3d get distance to camera(cam pos x,hit pos y+3,cam pos z)>3
position cam's y to cam pos - gravity# (about 0.5)
else
if b3d get distance to camera(cam pos x,hitpos y+3,cam pos z)<3
position cam to cam pos x,hit pos y+3,cam pos z
endif
endif

The above "code" should work in theory, but I don't have a raycaster (DarkPhys one don't work).....so what is Sparkys?

Clonkex

Making games is easy.....finishing them is a different matter.

Login to post a reply

Server time is: 2024-11-24 15:40:24
Your offset time is: 2024-11-24 15:40:24