Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Trading Journey
by 7th_zorro. 04/27/24 04:42
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Akow, AndrewAMD, Quad), 733 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 5
Page 31 of 41 1 2 29 30 31 32 33 40 41
Re: Newton 2 wrapper [Re: VeT] #291022
09/23/09 00:01
09/23/09 00:01
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline
Serious User
darkinferno  Offline
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
the reason why this isnt used as much as it could be is its ease of use, like how the physX plugin maintains some similarites to the native gs plugin in terms of function calls, its rather hard for me to make any progress if i have to keep learning new systems, with that said... keep up the work, i for one prefer newton over physX, just that learning to use it properly isnt on my todo list atm

Re: Newton 2 wrapper [Re: darkinferno] #291258
09/24/09 09:08
09/24/09 09:08
Joined: Dec 2003
Posts: 1,225
germany
gri Offline
Serious User
gri  Offline
Serious User

Joined: Dec 2003
Posts: 1,225
germany
hi VET,

please keep up your process on that.

Because of at least 2 Reasons:

1. You put already much energy and time in your Wrapper.

2. Its good for us all to have an Alternative to the PhysX Plugin(of course its great).


The A8 version somedays comes with PhysX only because ODE is outdated.

So if one of us needs Physics in his game but dont want to forcing the customers to install the PhysX Drivers, then is the Use of your wrapper the right Decision.

And I think NOT a lot uf us needs Physics for Clothing in our games in near future.
(Even with PhysX its only a Gadget without practical Use in Moment - it only decreasing the Framerate )


So keep up your good work.

greetings,
maik


"Make a great game or kill it early" (Bruce Shelley, Ensemble Studios)
Re: Newton 2 wrapper [Re: gri] #291774
09/27/09 20:06
09/27/09 20:06
Joined: Sep 2004
Posts: 178
J
jweb Offline
Member
jweb  Offline
Member
J

Joined: Sep 2004
Posts: 178
sorry for my repeated the question, but I can coding with the wrapper a car?

THX

Re: Newton 2 wrapper [Re: jweb] #291881
09/28/09 18:13
09/28/09 18:13
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP

Serious User
VeT  Offline OP

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
jweb, you can code everything you want: files for using DLL are ready... now i'm working only on examples (so, if programmer knows Newton good, he can create car even with v.1 of wrapper laugh )

Thatks for good words, guys, Newton beta 10 is out, i'll continue my wrapper wink


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: Newton 2 wrapper [Re: VeT] #291947
09/29/09 09:51
09/29/09 09:51
Joined: Dec 2003
Posts: 1,225
germany
gri Offline
Serious User
gri  Offline
Serious User

Joined: Dec 2003
Posts: 1,225
germany
hi VET,

one question:

First I thought I have to install something because I couldnt control the camera in your examples.

Then I put in some code for camera movement & rotating and it works.
Did you just forget it in the last version?

,gri


"Make a great game or kill it early" (Bruce Shelley, Ensemble Studios)
Re: Newton 2 wrapper [Re: gri] #292249
10/01/09 13:49
10/01/09 13:49
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
The start function which automatically creates the collision data from the level for Newton should return a NewtonBody pointer. Why?
this way the whole level can be used with other materials than just the default one.

Yes, I can modify the function on my own, just wanted to share that for a future improvement.

Re: Newton 2 wrapper [Re: FBL] #292535
10/04/09 15:33
10/04/09 15:33
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
more things:

I'd like to have an interface for newtonFPS so I can modify it without having to change your script.

Also I have added two useful functions, maybe you want to include them in the wrapper:

Code:
NewtonJoint* newton_getjoint(ENTITY* entBody)
{
	NewtonJoint* psJoint = NULL;
	
	if (entBody->skill98 != 0)
	{
		psJoint = entBody->skill98;
	}
	return psJoint;
}

NewtonBody* newton_getbody(ENTITY* entBody)
{
	NewtonBody* psBody = NULL;
	
	if (entBody->skill99 != 0)
	{
		psBody = entBody->skill99;
	}
	return psBody;
}



I store the joint pointer in skill98 of the object.


Next thing:

newton_materials_init() should not be included in newton_start() as it seems to be a definition for special physics samples.

Quant2meter and meter2quant should already be included in newton_main.c like this:
#ifndef QUANTTOMETER
#define QUANTTOMETER (float)0.03125
#endif

#ifndef METERTOQUANT
#define METERTOQUANT (float)32
#endif
This allows redefining them before inclusion of the wrapper in the own project


I also added this simple thing to newton_main.c:

Code:
NewtonWorld* nworld = NULL;



NewtonWorld* newton_getworld()
{
	return nworld;
}


Now nworld doesn't have to be defined in own scripts. If it's needed, it can be retrieved via this access function.

The goal of all my requests: I can just drop the latest release in my project folder, without having to adjust a single line laugh
Maybe you want to include some of this stuff in the next version of the wrapper.

Thanks for reading

Re: Newton 2 wrapper [Re: FBL] #292536
10/04/09 15:40
10/04/09 15:40
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
Oh, right.
I created a simple hinge setup function.
Maybe you're interested:

Code:
NewtonJoint* newton_createhinge(VECTOR* vecPivot, VECTOR* vecAxis, ENTITY* entBody1, ENTITY* entBody2, void* fpCallback)
{
	NewtonBody* psBody1 = NULL;
	NewtonBody* psBody2 = NULL;
	NewtonJoint* psJoint;
	float* fpPivot;
	float* fpAxis;
	
	/* get Newton bodies */
	if (entBody1 != NULL)
	{
		psBody1 = entBody1->skill99;
	}
	
	if (entBody2 != NULL)
	{
		psBody2 = entBody2->skill99;
	}

	fpPivot = vectorf(vecPivot);
	fpPivot[0] *= QUANTTOMETER;
	fpPivot[1] *= QUANTTOMETER;
	fpPivot[2] *= QUANTTOMETER;

	fpAxis = vectorf(vecAxis);

	psJoint = NewtonConstraintCreateHinge (psWorld, fpPivot, fpAxis, psBody1, psBody2);
	if (fpCallback != NULL)
	{
		NewtonHingeSetUserCallback (psJoint, fpCallback);
	}


	/* store joint pointers in related objects */
	if (entBody1 != NULL)
	{
		entBody1->skill98 = psJoint;
	}
	
	if (entBody2 != NULL)
	{
		entBody2->skill98 = psJoint;
	}
}



Re: Newton 2 wrapper [Re: FBL] #292550
10/04/09 17:58
10/04/09 17:58
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP

Serious User
VeT  Offline OP

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
Originally Posted By: gri
Then I put in some code for camera movement & rotating and it works.
Did you just forget it in the last version?

Hm, really, i confirmed this bug... Maybe, this is beacuse of new version of GS, as i never get this before and nobody told me about this.

Now i'll add camera code, make and upload pictures, re-read your posts and release new version. wink

2Firoball thanks for code, i'll look into it and add it to next version, if everything would be okay wink thanks for your code, looking like usefull


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: Newton 2 wrapper [Re: VeT] #292558
10/04/09 19:55
10/04/09 19:55
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
How about a slider hinge?

Code:
NewtonJoint* newton_createslider(VECTOR* vecPivot, VECTOR* vecDir, ENTITY* entBody1, ENTITY* entBody2, void* fpCallback)
{
	NewtonBody* psBody1 = NULL;
	NewtonBody* psBody2 = NULL;
	NewtonJoint* psJoint;
	float* fpPivot;
	float* fpDir;
	
	/* get Newton bodies */
	if (entBody1 != NULL)
	{
		psBody1 = entBody1->skill99;
	}
	
	if (entBody2 != NULL)
	{
		psBody2 = entBody2->skill99;
	}

	fpPivot = vectorf(vecPivot);
	fpPivot[0] *= QUANTTOMETER;
	fpPivot[1] *= QUANTTOMETER;
	fpPivot[2] *= QUANTTOMETER;

	fpDir = vectorf(vecDir);

	psJoint = NewtonConstraintCreateSlider(psWorld, fpPivot, fpDir, psBody1, psBody2); 
	if (fpCallback != NULL)
	{
		NewtonSliderSetUserCallback (psJoint, fpCallback);
	}
	
	/* store joint pointers in related objects */
	if (entBody1 != NULL)
	{
		entBody1->skill98 = psJoint;
	}
	
	if (entBody2 != NULL)
	{
		entBody2->skill98 = psJoint;
	}
}



Thought I might share this. Almost the same code like for a hinge though.


Page 31 of 41 1 2 29 30 31 32 33 40 41

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