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.

DarkBASIC Discussion / Collisions

Author
Message
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 1st Jul 2005 23:28
hi, im making a space game and theres a model of a docking ship, how would i get the camera to collide with it (in sliding collision)

Your signature has been erased by a mod because it's larger than 600x120...
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 2nd Jul 2005 04:17
Zotoaster,

Use the same method used for object collision. Check the forums, because there is an extensive amount of posts on this very topic.


+NanoBrain+
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 3rd Jul 2005 01:57
ive checked, unfortunatelly, in all the posts everyone asks about it and noone answers properly..

Your signature has been erased by a mod because it's larger than 600x120...
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 3rd Jul 2005 08:05
Zotoaster,

When you say collide, are you needing the camera to be able to dock onto the ship. So to say, to land on the ship? Or, do you need the camera to be able to literally collide with the ship, as so the camera will not go through the ship?


+NanoBrain+
Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 3rd Jul 2005 19:57
Zotoaster,

Do it like this..
If the camera (the spaceship) is too close then you show a docking movie or a docking script. It easy to avoid the collision in an
endless space

[href][/href]
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 3rd Jul 2005 21:39
make a sphere around your camera and get the collision of the sphere.

Immunity and Annihalation makes Immunihalation...
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 4th Jul 2005 09:56
nah, i just need it so that i acnt go through the ship, i quite like sven b's idea, though im not sure how to get the sphere to collide with it, i tryed out sparky's collision dll for db, but it just didnt seem to work:S, any ideas?

Your signature has been erased by a mod because it's larger than 600x120...
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 4th Jul 2005 18:20
Zotoaster,

An alternative to the sphere method, is to find the distance between the player and the ship, not allowing the player to get within a certain distance from the ship. Technically, this is the same as sphere collision, however, with the need to work out some of the math for the collisions between the two yourself.


+NanoBrain+
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 4th Jul 2005 19:03
hmmm, i dont reall think that would work, coz i start off on the ship, ive been told that you can do sliding collision with a .x model, does anyone know how to do that?

Your signature has been erased by a mod because it's larger than 600x120...
blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 12th Jul 2005 18:58
So you just don't want the camera to go INSIDE the ship?

How's my typing? Phone 0800-GO-TO-HELL
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 12th Jul 2005 21:46
Yes, make collision boxes with the
make object collision box object_nr,X,Y,Z,X2,Y2,Z2,rotate_flag.

object_nr determines wich object the collision box should follow.
X,Y,Z,X2,Y2,Z2 determines the size of the collision box (origin of the object = origin of the collision box)
rotate_flag : 1: the collision box rotates with the object, 0: the collision box won't rotate with the object. I usually use 0 because you can use get object collision x/y/z().

Immunity and Annihalation makes Immunihalation...
Hop a long
21
Years of Service
User Offline
Joined: 12th May 2004
Location: The Code Dump
Posted: 18th Jul 2005 02:39
Zot

You still out there? I'm coding an answer. Should be ready soon.

Hop
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 18th Jul 2005 04:32
@Hop a long

thanks

@everyone else

the docking ship isnt a simple cuboid, it's an actual model, i just don't want to be able to go inside the ship, touching it is fine, but i don't want simple box collision

Your signature has been erased by a mod because it's larger than 600x120...
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 18th Jul 2005 19:49
This will return perfect collision...



I don't know how you could use it to stop the object from going through the ship though...

Immunity and Annihalation makes Immunihalation...
Hop a long
21
Years of Service
User Offline
Joined: 12th May 2004
Location: The Code Dump
Posted: 19th Jul 2005 07:56
Zot

I'm building a simple shuttle. I mean really simple shuttle. It's hard to find a good ship these days. The one I've got should serve for one last mission, then we'll use it for target practice. Anyone who comes on board will enter a small room. But you can't pass through any of the walls, inside or out. I'll post the demo code and the media will be available on my site. Once you see the technique you can adapt it to your model.

Hop
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 19th Jul 2005 08:07
Hop,

thanks

P.S. If your gonna shorten my name call me Zotos, thats my real second name

Your signature has been erased by a mod because it's larger than 600x120...
Hop a long
21
Years of Service
User Offline
Joined: 12th May 2004
Location: The Code Dump
Posted: 19th Jul 2005 10:46 Edited at: 21st Jul 2005 10:58
Zotoaster,

The code is written to work with the shuttle model I made. The entire demo, with media, is available on my web site. Follow the "Shuttle Dock" link.

Good Luck,
Hop A Long

Login to post a reply

Server time is: 2025-05-22 20:15:32
Your offset time is: 2025-05-22 20:15:32