Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, juanex, Grant), 1,018 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
ent_setvertex and c_trace #316958
03/28/10 05:34
03/28/10 05:34
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline OP
Serious User
Widi  Offline OP
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
I have a Terrain that i transform with ent_getvertex and ent_setvertex. After that i use a c_trace to the Terrain, but the hit position (target) is always from the old (untransformed) Terrain.

How can i do that after ent_setvertex the c_trace gives the right pos?

Re: ent_setvertex and c_trace [Re: Widi] #317103
03/29/10 10:42
03/29/10 10:42
Joined: May 2006
Posts: 148
Latvia
MTD Offline
Member
MTD  Offline
Member

Joined: May 2006
Posts: 148
Latvia
Before calling c_trace (After You have moved terrain vertexes)
recalculate the terrain ent_fixnormals( ENTITY*,var frame)

Re: ent_setvertex and c_trace [Re: MTD] #317114
03/29/10 11:25
03/29/10 11:25
Joined: Dec 2003
Posts: 1,225
germany
gri Offline
Serious User
gri  Offline
Serious User

Joined: Dec 2003
Posts: 1,225
germany

or

c_updatehull


"Make a great game or kill it early" (Bruce Shelley, Ensemble Studios)
Re: ent_setvertex and c_trace [Re: gri] #317180
03/29/10 20:41
03/29/10 20:41
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline OP
Serious User
Widi  Offline OP
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
c_updatehull works, thanks a lot. With ent_fixnormals i have problems, because it should work also with chunked terrains.

I think first, c_updatehull only update the boundingbox. Learning some more, thanks

Re: ent_setvertex and c_trace [Re: Widi] #317398
03/31/10 10:59
03/31/10 10:59
Joined: Dec 2003
Posts: 1,225
germany
gri Offline
Serious User
gri  Offline
Serious User

Joined: Dec 2003
Posts: 1,225
germany
Originally Posted By: Widi
...

I think first, c_updatehull only update the boundingbox ...


hi,

thats right and it works because your terrain's bounding box is not a simple cube - its polygon collsision.


,gri


"Make a great game or kill it early" (Bruce Shelley, Ensemble Studios)
Re: ent_setvertex and c_trace [Re: gri] #317412
03/31/10 14:30
03/31/10 14:30
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline OP
Serious User
Widi  Offline OP
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Hello again. c_updatehull works perfectly with unchunked terrain, but sometimes with chunked terrain c_trace not hit the terrain. I don`t can figure out why sometimes it works and sometimes not.

Re: ent_setvertex and c_trace [Re: Widi] #317451
03/31/10 19:13
03/31/10 19:13
Joined: Dec 2003
Posts: 1,225
germany
gri Offline
Serious User
gri  Offline
Serious User

Joined: Dec 2003
Posts: 1,225
germany

hi,

sadly I did my digging experiences with ent_setvertex with a single terrain only.

Try to follow your trace-ray with an particle and draw a single point at the hit position
like ...draw_point3d(temp,vector(0,0,255),100,3);.
So you can be shure the trace works right.

Does it happen when you "stand" upon terrain_A and trace into terrain_B?

Where do you declare the Contract struct?
...CONTACT* c = ent_getvertex(Eterr,NULL,i);

If you do it inside a function, maybe in a while-loop? So dont forget to release the pointer after using.
Better declare it outside as global.


regards,
gri


"Make a great game or kill it early" (Bruce Shelley, Ensemble Studios)
Re: ent_setvertex and c_trace [Re: gri] #317463
03/31/10 19:50
03/31/10 19:50
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline OP
Serious User
Widi  Offline OP
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Trace works right, checked already with drawline. Have only one terrain and a free Camera code that is attachet to a Dummy entity. No more entities. (it is a editor for deform a terrain that i want to do).

The Contact struct is ok too

CONTACT* c = ent_getvertex(my,NULL,dt_vertex_nr);
c.v = NULL;
vec_for_ent (c.x, my);

But no Problem, i can work only with unchunked Terrains. Thanks

EDIT: I see now in the Bugforum that there is a bug with ent_setvertex and chunked terrain....
ent_setvertex sometimes left 'gaps' in chunked terrain (fixed in 7.81.8)

Last edited by Widi; 04/01/10 04:49.

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1