Files |  Tutorials |  Articles |  Links |  Home |  Team |  Forum |  Wiki |  Impressum

Aktuelle Zeit: Fr Mai 24, 2024 07:04

Foren-Übersicht » English » English Programming Forum
Unbeantwortete Themen | Aktive Themen



Ein neues Thema erstellen Auf das Thema antworten  [ 7 Beiträge ] 
Autor Nachricht
 Betreff des Beitrags: glNewtonRagDoll + glNewtonScene3DS
BeitragVerfasst: Sa Nov 20, 2004 23:04 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
I tryed to add ragdolls to the 3ds demo using the ragdoll source. But the ragdolls arn't rendered and a access violation happens when the program is closed (but the ball collides with the ragdoll)

Note: Newton.dll and glNewtonScene3DS Scene and textures not included (to keep it under 250kb)
Note 2: The ragdoll is "spawned" under the 1 in railroad.3ds


Dateianhänge:
Dateikommentar: Modifyed Version
glNewtonScene3DS.zip [125.01 KiB]
295-mal heruntergeladen

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu
Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mo Nov 22, 2004 16:55 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
Just for information : I've downloaded that demo yesterday, but I haven't had the time to dig deeper into it and find the bug. So please give me some time and I'll inform you on what causes the problem.

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mo Nov 22, 2004 17:00 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
k, thanks. If you wonder why id like to merge the 2, its cos im wanting to test Newton in a bsp world.

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Nov 23, 2004 00:04 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
The ragdoll in your demo is perfectly working. You should have checked the rendering. You not only render the ragdolls at the wrong place in the code (so that they can't be seen), but you also don't activate VertexArrays when rendering the RagDolls. So you need to draw them right after you've drawn the 3DS-Scene (in your source, you render them after the camera has finally been set) and you need to enable vertex- and normalarrays before rendering the ragdoll.

The access violation when exiting then still occurs, but that seems to be another thing, cause the RagDoll works.

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Nov 23, 2004 10:12 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
Thx. The access violation only seem to happen when NewtonDestroy(NewtonWorld); is called....... Yet the ragdoll demo calls the same thing in the same place.

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Nov 23, 2004 12:32 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
That may be a bug in the version of Newton used in that demos. I'll try with the newest version, but for that I'll have to change some things in the source. I'll inform you if it works with the new newton DLL.

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Do Dez 02, 2004 12:16 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
Haven't had the time to take a look into it earlier, but I found the "problem" : It lies in the material collision callbacks GenericContactBegin and GenericContactProcess. I use NewtonBodyGetUserData there to get user data from the ball (which is a normal newton body). But this function (as the name suggests) only works on bodies, not on ragdolls, so it causes the crash (not immediately but at exiting). So you need to define a special material for the ragdolls that won't call those callbacks. So in TGLForm.InitTimerTimer do this :
Code:
  1. // Ragdoll
  2. MatRagDoll := NewtonMaterialCreateGroupID(NewtonWorld);
  3. NewtonMaterialSetDefaultElasticity(NewtonWorld, MatWorld, MatRagDoll, 0.3);
  4. NewtonMaterialSetDefaultFriction(NewtonWorld, MatWorld, MatRagDoll, 1.1, 0.7);
  5.  

MatRagDoll is an integer, defined in the ragdoll unit.

And in RagDoll.Create at the end change the loop to the following :
Code:
  1. for i := 0 to High(Bone) do
  2.  begin
  3.  NewtonBodyGetMatrix(Bone[i].Body, @Bone[i].StartMatrix[0,0]);
  4.  NewtonBodySetMaterialGroupID(Bone[i].Body, MatRagdoll);
  5.  end;


The ragdoll now has it's own material and the callback (which causes the problems) won't get called when the ragdoll collides with the world or player.

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 7 Beiträge ] 
Foren-Übersicht » English » English Programming Forum


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast


Du darfst keine neuen Themen in diesem Forum erstellen.
Du darfst keine Antworten zu Themen in diesem Forum erstellen.
Du darfst deine Beiträge in diesem Forum nicht ändern.
Du darfst deine Beiträge in diesem Forum nicht löschen.
Du darfst keine Dateianhänge in diesem Forum erstellen.

Suche nach:
Gehe zu:  
cron
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.009s | 15 Queries | GZIP : On ]