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.

DLL Talk / explose my barrel?

Author
Message
stcp
18
Years of Service
User Offline
Joined: 23rd Apr 2006
Location: france , limoge
Posted: 23rd Apr 2006 20:34
hello, I have create a barrel and I wants to explode it.

here my ordering of choot:

my probléme is that barrel_body did not detecté !

help me please


ps:sorry for my English
Vincentv
18
Years of Service
User Offline
Joined: 14th Feb 2006
Location: France
Posted: 24th Apr 2006 00:45
It's the wrong board...
Splurk
18
Years of Service
User Offline
Joined: 8th Apr 2006
Location: France/Montpellier
Posted: 24th Apr 2006 17:13
Hi stpc

Ok first, as noticed by Vincentv, you're not on the good board (dbpro should be the good one).

And no french accents in english... ^^ That's not making thing understandable.

Do you have the same problem that we've discussed on the french forum?

You may also make notice that you're using Newton Wrapper for your program. That could help because nobody can understand what is your problem!

stcp
18
Years of Service
User Offline
Joined: 23rd Apr 2006
Location: france , limoge
Posted: 24th Apr 2006 21:05
hello, I have create a barrel and I wants to explode it.

here my ordering of choot:



my probléme is that barrel_body did not detecté !

help me please

ps: sorry for my english
stcp
18
Years of Service
User Offline
Joined: 23rd Apr 2006
Location: france , limoge
Posted: 25th Apr 2006 19:56
ok, I use the order of choot of the demo 5 of newton and I would like to explode the one barrel, but the HitBody function = NDB_RayCastGetBody() does not want to return me the number of the body touched to inflict an action to him!
for my test
boum = NDB_RayCastGetBody(barrel)
if boum then end
barrel is a object creates as limp them of the demo!
stcp
18
Years of Service
User Offline
Joined: 23rd Apr 2006
Location: france , limoge
Posted: 3rd May 2006 20:14
here my ordering of choot:

if mouseclick()=1 and MOUSE =0 and muni>0
MOUSE =1
tir=1
DEC muni,1
dec hud_bullet,1



`user wants to shoot! let's cast a ray with Newton and see if we've hit something!
x1# = camera position x() : y1# = camera position y() : z1# = camera position z()

`get a unit vector in the direction the player is facing, by moving the camera 1 unit!
move camera 1.5
x2# = camera position x() : y2# = camera position y() : z2# = camera position z()
move camera -1.5

`we will cast a ray 500 units long.
dx# = x2# - x1#
dy# = y2# - y1#
dz# = z2# - z1#

x2# = x1# + (dx# * 500.0)
y2# = y1# + (dy# * 500.0)
z2# = z1# + (dz# * 500.0)

`cast the ray. put start point in vector 1, end point in vector 2
NDB_SetVector 1, x1#, y1#, z1#
NDB_SetVector 2, x2#, y2#, z2#

dist# = NDB_NewtonWorldrayCast()
if dist# < 1.0


`something hit!
HitBody = NDB_RayCastGetBody()

castdist# = dist# * 500.0
cast_x# = x1# + (dx# * castdist#)
cast_y# = y1# + (dy# * castdist#)
cast_z# = z1# + (dz# * castdist#)

hitmass# = NDB_NewtonBodyGetMassMatrix( HitBody )

if hitmass# > 0.0
`this is a live object, give it a kick!
NDB_SetVector 1, cast_x#, cast_y#, cast_z#
NDB_SetVector 2, dx# * Player_ShootPower#, dy# * Player_ShootPower#, dz# * Player_ShootPower#, 0.0
NDB_BodyAddForceGlobal HitBody
NDB_NewtonWorldUnfreezeBody HitBody

else
`this is the background (mass=0), add a bullethole!



bullet= MakeSphere(cast_x#-(dx#*0.01),cast_y#-(dy#*0.01),cast_z#-(dz#*0.01),0.2,23.0)


rem this for the test explose
boum = NDB_RayCastGetBody(barrel_body)
if boum then end


endif
endif
endif
if mouseclick() = 0 then MOUSE = 0


here my ordering barrel:

function Makebarrel(obj,r#,h#,rx#,ry#,rz#,mass#,bpx#,bpy#,bpz#)

remstart
bpx#,bpy#,bpz#=position
rx#,ry#,rz#=rotation
R#=rayon
h#=hauteur
remend

Col = NDB_NewtonCreateCylinder( r#,h#,)
barrel_Body = NDB_NewtonCreateBody(Col)
`Set initial position and rotation
NDB_BuildMatrix rx#, ry#, rz#,bpx#,bpy#,bpz#
NDB_NewtonBodySetMatrix barrel_Body

`calculate MI for a cylinder.
NDB_CalculateMICylinderSolid mass#, R#, h#
NDB_NewtonBodySetMassMatrix barrel_Body, mass#
NDB_NewtonReleaseCollision Col

` make object cylinder obj,1

obj = FreeObject()
print_load("[ barrel.x ]",1)
load object "Media\Models\barrel\barrel.X",obj
scale object obj, h#*50.0, r#*140.0, r#*140.0
NDB_BodySetDBProData barrel_Body, obj
fix object pivot obj
NDB_NewtonBodySetDestructorCallback barrel_Body
NDB_BodySetGravity barrel_Body, 1


endfunction barrel_Body


my probléme is that barrel_body did not detecté !

help me please
stcp
18
Years of Service
User Offline
Joined: 23rd Apr 2006
Location: france , limoge
Posted: 7th May 2006 02:59
do you have solution please
Bob da reaper
18
Years of Service
User Offline
Joined: 25th Mar 2006
Location:
Posted: 28th May 2006 22:02
he just told you a solution

I pwn n00bs - current project "Darkness Falls"

Login to post a reply

Server time is: 2024-11-22 05:53:20
Your offset time is: 2024-11-22 05:53:20