Raised This Month: $ Target: $400
 0% 

Model collision with world


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
sgtbane
Member
Join Date: Feb 2006
Old 07-02-2007 , 19:49   Model collision with world
Reply With Quote #1

I cant get collisions to work properly with my created entity.

Code:
public makeapc(id) 
{
	new Float:origin[3]
	pev(id, pev_origin, origin)
	new apc = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
	if(!apc) 
	{
		client_print(id,print_chat,"Error: APC WAS not created.")
		return PLUGIN_HANDLED
	}
	client_print(id, print_chat, "APC: %i", apc)
	set_pev(apc, pev_classname, "item_apc")
	dllfunc(DLLFunc_Spawn, apc)
	
	new Float:angles[3] = {0.0, 0.0, 0.0}
	new Float:fmins[3] = {-80.0, -80.0, -90.0}
	new Float:fmaxs[3] = {80.0, 80.0, 0.0}
	
	engfunc(EngFunc_SetModel, apc, "models/banes/APC03.mdl")
	origin[2] += 90
	engfunc(EngFunc_SetOrigin, apc, origin)
	engfunc(EngFunc_SetSize, apc, mins, maxs)
	
	set_pev(apc, pev_angles, angles)
	set_pev(apc, pev_takedamage, 1.0)
	set_pev(apc, pev_health, 500.0)
	set_pev(apc, pev_movetype, MOVETYPE_PUSHSTEP)
	set_pev(apc, pev_solid, 2)
	
	set_pev(apc, pev_nextthink, get_gametime() + 0.01)
	dllfunc(DLLFunc_Think, apc)
	return PLUGIN_HANDLED
}
The bounding box doesen't seem to want to collide with all walls. It will collide with players, but when driving into walls, the maxs half of the box just go right through the walls.
Ignore the z axis box. It extends below since the center bone of the model is in the center-top of the model so that when attaching a camera you can view above it.

I am trying to make a driveable vehicle that will be able to hold multiple people, where you simply walk up to it, press your key, instead of the crappy cars built into cs.
I am doing this for the possibility of:
vehicles that take damage, mobile mounted weapons, and hopefully better physics then the default 1.6 ones.

any help with the collisions would be aprecieated.
Thanks.
__________________
[Add|Community]

~SgtBane
sgtbane is offline
Send a message via MSN to sgtbane
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:29.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode