Dynamic Objects
by Newbie · in Torque Game Engine · 06/30/2006 (10:35 am) · 28 replies
Hi All,
I've been trying to figure this out for a few days and have tried searching, but what I found couldn't help me or had bad links.
What I'm trying to do is create a dynamic cube or some kind of shape through the C++ code. It seems something very simple, but I can't figure it out. I would also like to be able to set it's position, scale, rotate it, and rotate it around a point at will later on too. The Shapes I would prefer not to interact with any of the physics of the Engine, and move their positions accordingly to what I have hard coded. But the key to this, is that I would want to do this through C++ and also I would want to create these dynamically during the run, which I can figure out where to code it, but I can't figure out what calls I need to do just to create a cube and put it inside the engine.
I've used 3DSTATE and TrueVision before using this tool and was able to figure it out easily, but for some reason I can't figure this out for Torque.
I would also like to be able to load a world without going through any initial gui interface or logo.
These seem to be simple things, but I just can't figure them out.
All help is appreciated.
I've been trying to figure this out for a few days and have tried searching, but what I found couldn't help me or had bad links.
What I'm trying to do is create a dynamic cube or some kind of shape through the C++ code. It seems something very simple, but I can't figure it out. I would also like to be able to set it's position, scale, rotate it, and rotate it around a point at will later on too. The Shapes I would prefer not to interact with any of the physics of the Engine, and move their positions accordingly to what I have hard coded. But the key to this, is that I would want to do this through C++ and also I would want to create these dynamically during the run, which I can figure out where to code it, but I can't figure out what calls I need to do just to create a cube and put it inside the engine.
I've used 3DSTATE and TrueVision before using this tool and was able to figure it out easily, but for some reason I can't figure this out for Torque.
I would also like to be able to load a world without going through any initial gui interface or logo.
These seem to be simple things, but I just can't figure them out.
All help is appreciated.
#2
By the way, one quick question...As far as the engine physics go for these objects, do you know off hand how I can turn the physics off for them?
06/30/2006 (11:25 am)
Thank you Stephen, you've been a lot of help. I haven't come across that resource. Sorry mix up earlier. I'm going to read that article.By the way, one quick question...As far as the engine physics go for these objects, do you know off hand how I can turn the physics off for them?
#3
Physics in general in Torque is highly coupled with the network code, and true understanding of how to correctly implement/remove physics changes is a somewhat complex topic, but in general physics for a class is implemented in the ::processTick() method of your class on the server, and ::processTick(), ::interpolateTick() on the client.
As a commercial client, you may be aware of, and/or interested in our Torque Boot Camps. Primary object hierarchy, the networking and physics models (and their integration), as well as many more areas are fundamental topics covered in depth during the camps.
And for the Indies--we realize that you probably aren't budgetted for a full commercial Boot Camp, but we do provide Indie Torque Boot Camps every year around our IndieGamesCon. This specialized Boot Camp is priced to be reachable for serious Indie developers, and has some special content geared specifically for you!
06/30/2006 (11:37 am)
Every class you create (below GameBase, where the first real concept of physics is introduced) implements it's own physics. Since the above resource directly inherits from SceneObject (which is higher than GameBase in the hierarchy), by default your generic render class isn't going to have any physics at all.Physics in general in Torque is highly coupled with the network code, and true understanding of how to correctly implement/remove physics changes is a somewhat complex topic, but in general physics for a class is implemented in the ::processTick() method of your class on the server, and ::processTick(), ::interpolateTick() on the client.
As a commercial client, you may be aware of, and/or interested in our Torque Boot Camps. Primary object hierarchy, the networking and physics models (and their integration), as well as many more areas are fundamental topics covered in depth during the camps.
And for the Indies--we realize that you probably aren't budgetted for a full commercial Boot Camp, but we do provide Indie Torque Boot Camps every year around our IndieGamesCon. This specialized Boot Camp is priced to be reachable for serious Indie developers, and has some special content geared specifically for you!
#4
06/30/2006 (12:01 pm)
Thanks again Stephen for your help. I've found the info posted very useful.
#5
06/30/2006 (12:07 pm)
Thanks again Stephen for your help. I've found the info posted very useful.
#6
new register no source code no sdk?
how do you modify the code with no sdk?
Edit:
ouch and look at all the gold Stephen shared! :)
Edit:
this must be a website update issue then?
as this is a private forum no?
I just wonder why this question is asked again with a different accout.
06/30/2006 (1:17 pm)
This is the same fellow asked the same question under a different alias?new register no source code no sdk?
how do you modify the code with no sdk?
Edit:
ouch and look at all the gold Stephen shared! :)
Edit:
this must be a website update issue then?
as this is a private forum no?
I just wonder why this question is asked again with a different accout.
#7
Once he was informed that he can change his display name, he logged into his TSE Commercial Licensed account, and reposted the question in a private forum, as he was asked.
It's taken care of. We do appreciate you guys trying to keep an eye out for us though!
06/30/2006 (1:56 pm)
@Badguy: As was mentioned in the other post, he was trying to perserve his real name anonymity, not knowing he could change his display name, so he created a new account to ask the question.Once he was informed that he can change his display name, he logged into his TSE Commercial Licensed account, and reposted the question in a private forum, as he was asked.
It's taken care of. We do appreciate you guys trying to keep an eye out for us though!
#8
that is much more complex than I had imagined :)
sorry to give the poor guy a hassle then :)
06/30/2006 (2:22 pm)
Ahh Ok.that is much more complex than I had imagined :)
sorry to give the poor guy a hassle then :)
#9
So far I've been using the following in the intialize game,
fxRenderObject *myFxRenderObject=new fxRenderObject();
myFxRenderObject->setPosition(Point3F(0,0, 1000));
myFxRenderObject->onAdd();
but I can't find the object, most likely because it has no representation, and it is this which is confusing me, because I'm unsure where and how to tell the class what the object should look like.
Am I missing something in the documentation, because I can't seem to find his example of how he actually makes the cubes in the example picture? I just see documentation of the actual class. I'm probably missing a key point here somewhere.
I really do appreciate the help.
07/11/2006 (2:33 pm)
Okay thanks again for the help. I've been reading the articles posted, primarily Melv's. I've also looked at the TSshape class. I understand Melv's article but no way 100%, but I get the gist, but I'm having trouble figuring out how to actually use the class.So far I've been using the following in the intialize game,
fxRenderObject *myFxRenderObject=new fxRenderObject();
myFxRenderObject->setPosition(Point3F(0,0, 1000));
myFxRenderObject->onAdd();
but I can't find the object, most likely because it has no representation, and it is this which is confusing me, because I'm unsure where and how to tell the class what the object should look like.
Am I missing something in the documentation, because I can't seem to find his example of how he actually makes the cubes in the example picture? I just see documentation of the actual class. I'm probably missing a key point here somewhere.
I really do appreciate the help.
#10
So far I've been using the following in the intialize game,
fxRenderObject *myFxRenderObject=new fxRenderObject();
myFxRenderObject->setPosition(Point3F(0,0, 1000));
myFxRenderObject->onAdd();
but I can't find the object, most likely because it has no representation, and it is this which is confusing me, because I'm unsure where and how to tell the class what the object should look like.
Am I missing something in the documentation, because I can't seem to find his example of how he actually makes the cubes in the example picture? I just see documentation of the actual class. I'm probably missing a key point here somewhere.
I really do appreciate the help.
07/11/2006 (2:35 pm)
Okay thanks again for the help. I've been reading the articles posted, primarily Melv's. I've also looked at the TSshape class. I understand Melv's article but no way 100%, but I get the gist, but I'm having trouble figuring out how to actually use the class.So far I've been using the following in the intialize game,
fxRenderObject *myFxRenderObject=new fxRenderObject();
myFxRenderObject->setPosition(Point3F(0,0, 1000));
myFxRenderObject->onAdd();
but I can't find the object, most likely because it has no representation, and it is this which is confusing me, because I'm unsure where and how to tell the class what the object should look like.
Am I missing something in the documentation, because I can't seem to find his example of how he actually makes the cubes in the example picture? I just see documentation of the actual class. I'm probably missing a key point here somewhere.
I really do appreciate the help.
#11
07/11/2006 (2:36 pm)
Thanks again for your help in advance, I will be around in about a day to check for updates.
#12
07/11/2006 (2:37 pm)
Thanks again for your help in advance, I will be around in about a day to check for updates.
#13
07/11/2006 (2:38 pm)
That was a very leet time to have posted.
#14
07/11/2006 (2:40 pm)
Thanks again for your help in advance, I will be around in about a day to check for updates.
#15
By the way, does anybody know why I'm making multiple posts, I'm starting to think it's the refresh?
07/11/2006 (2:41 pm)
What do you mean?By the way, does anybody know why I'm making multiple posts, I'm starting to think it's the refresh?
#16
07/11/2006 (2:48 pm)
It is.
#17
07/11/2006 (2:59 pm)
Too late to ask a question you mean?
#18
07/11/2006 (3:00 pm)
Too late to ask a question you mean?
#20
07/12/2006 (6:55 am)
Could you clarify Cliff, are you saying there are certain times in which one should post?
Torque 3D Owner Stephen Zepp
For what you've described in your first section, this is probably your best route for study, then implementation. Please realize a couple of things:
--since you've mentioned you want to create these shapes dynamically, you can either study and learn the TSShape class and modify/reimplement from it for your dynamic generation and modification, or you can come up with your own internal representation of the object and use the above resource to get it working in the engine.
--you'll be responsible for the rendering code itself in your new class's onRender method, so you'll probably be using OpenGL calls to render your cube (or whatever you decide to render).
On your second part, you'll want to basically cut out the entire execution path of the gui system used on the client, and get directly to the meat of the connection. Since Torque is always client/server (even single player, one executable), the important things are to init the server, init the client, and connect the two.
There are a couple of tutorials called "MinApp" which may help you along with this process, but they strip -everything- out, and then move forward, so I'm not sure that's your best bet.