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.

Author
Message
XFS Illusion
20
Years of Service
User Offline
Joined: 20th Apr 2006
Location:
Posted: 8th Jan 2012 17:55
I'm actually coding in .NET but the support base in this forum seems to be more active. I can translate any code if necessary. Here is my question...

Is there a way to use map collisions, such as load a model of a map and keep from passing through the walls, without using Sparky's collision? Reason I ask is because SC isn't available in .NET and i'm not sure how to compile it into a DLL to use in my NET project. All the examples i've found so far use SC.
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 8th Jan 2012 18:41
It is possible if you set your map to use polygon collision ( Set Object Collision To Polygons || DGDKPlugins.CDarkGDK.oDB3D.SetObjectCollisionToPolygons() ).

The intersect object function can be used to check if there is a collision between the player and the wall, before moving ahead. There should be a collision snippet in the forum which uses the standard intersection command.

XFS Illusion
20
Years of Service
User Offline
Joined: 20th Apr 2006
Location:
Posted: 8th Jan 2012 19:30 Edited at: 8th Jan 2012 19:31
By the way, what ever happened to the Load Static Objects command, does it still exist? I saw lots of examples which allow the use of FPSC maps, but my editor doesn't seem to recognize it.

I'm thinking about going back to DBP, the .NET version seems to be slow and lack support.
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 8th Jan 2012 19:36 Edited at: 8th Jan 2012 19:40
Hi there. Take a look to this two pieces of code attached. One works with old collision commands , and the second works using intersec object commmand. I hope it can help.



Cheers.



I'm not a grumpy grandpa
Brendy boy
20
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 8th Jan 2012 20:37
Quote: "Is there a way to use map collisions, such as load a model of a map and keep from passing through the walls, without using Sparky's collision? Reason I ask is because SC isn't available in .NET and i'm not sure how to compile it into a DLL to use in my NET project. All the examples i've found so far use SC. "

You can create a BSP out of your map. Checking for collision against BSP is very fast. The built in collision commands check every poly of an object for collision so if you have a compley map it will be slow.

XFS Illusion
20
Years of Service
User Offline
Joined: 20th Apr 2006
Location:
Posted: 8th Jan 2012 21:26
The code was a pain to translate to .net, but it worked well, thank you.

Brendy, BSP's was my first option, but I have no idea how to make one or convert an existing model to BSP. If there was a way to do this i'd seriously consider it.
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 8th Jan 2012 21:39
There was an application included in Dbpro to convert an x to BSP. You can use Quark6 that is free, but you will have to install Quake2 or Quake3 to compile the level and then use it in Dbpro.


Cheers.

I'm not a grumpy grandpa
XFS Illusion
20
Years of Service
User Offline
Joined: 20th Apr 2006
Location:
Posted: 8th Jan 2012 22:48
Here is the .NET translated code if anybody needs it. It also works with maps created with FPSC.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 9th Jan 2012 00:20
Thanks for the snippet

Cheers.

I'm not a grumpy grandpa
Brendy boy
20
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 9th Jan 2012 22:01
Quote: "Brendy, BSP's was my first option, but I have no idea how to make one or convert an existing model to BSP. If there was a way to do this i'd seriously consider it. "

There's a lot of code snippet on the internet for this, search. I recomend to take a look at Humus

You don't need the code for bsp rendering (a bit complicated), just for collision (i think that's called leaf based bsp - much simpler)

Login to post a reply

Server time is: 2026-07-09 23:12:05
Your offset time is: 2026-07-09 23:12:05