Author |
Message |
xpadmin
Site Admin
Joined: Thu Feb 07, 2013 11:16 am Posts: 1931
|
Code: type = REVOL; // Revolving (REVOL) or translating (PRISM) movement
axis0 = Z; // Revolving axis axis1 = X; // Opposite axis
Fc = 6.0; // Friction of joint
kd = 1.0; // Damping of joint
Ks = 0.2; // Spring force Ls = 0.0; // Spring angle q_min = -100; // Minimum rotation q_max = 1; // Maximum rotation
|
Mon Feb 02, 2015 10:01 pm |
|
 |
riftporn
Rank 16
Joined: Wed Aug 07, 2013 4:51 pm Posts: 315
|
Quick question regarding the stocks: I've tried to make the stock movable for the last couple hours with all the ini tricks that usually make an object movable. (dynamic=true, link{} etc) I couldn't make it. Are the stocks locked in place by the (hardcoded) stock object code? If not, how would I edit the stocks ini to make the stocks movable?
|
Mon Feb 02, 2015 11:28 pm |
|
 |
xpadmin
Site Admin
Joined: Thu Feb 07, 2013 11:16 am Posts: 1931
|
@riftporn It is possible to "attach" objects together. E.g.: Code: rb "pizzaBoxShape1" { dynamic = true; render{} physics {elem[0] {mesh = "collShape1";}} interact{} }
rb "pizzaBoxShape2" { link { type = REVOL; axis0 = X; axis1 = Z; Fc = 1.0; kd = 0.66; Ks = 0.0; Ls = 0.0; q_min = -265; q_max = 0; q = -192; }
render{} physics {elem[0] {mesh = "collShape2";}} interact{} }
// Instances are attached rbI "food2:pizzaBox1" {}
rbI "food2:pizzaBox2" { link { ref = "pizzaBox1";} }
You will need to have included the objects in the maya scene. In the example the pizzabox its rotating lid is attached to the box.
|
Tue Feb 03, 2015 12:32 am |
|
 |
rezzabae
Rank 14
Joined: Thu Aug 14, 2014 7:23 pm Posts: 156 Location: #0BADF00D - #FEED1337
|
xpadmin wrote: It is possible to "attach" objects together. Thats IT! This Info was the missing part in the puzzle! It was always there, that is what i was searching for! Why is that info so important? Because now we are able to create moving parts to which are moving parts attached. Some kind of mechanical rig and you even can use a remote control - hrhr. Great!
|
Tue Feb 03, 2015 12:44 am |
|
 |
riftporn
Rank 16
Joined: Wed Aug 07, 2013 4:51 pm Posts: 315
|
What I wanted to do is simply make the stock movable. In other words I want to drag them around like other objects. If thats possible, we could use the stocks object to make "chains" or similar bondage devices. The possibility to attach objects is great, but without hard coded object code to be able to lock the links in place ("lock the stocks") it is very limited for physical objects.
So my actual question was "how do I edit the stocks ini so I can drag the whole stocks around the room and still be able to open, close and lock them?". Whatever I tried, the game either crashed with a weird sys file error or the stocks just remained locked in place.
What would be super great and handy is an all-purpose "machine" object that lets us attach multiple, chained revolving or linear motion objects together while giving us the possibility to a) move each single joint by script / remote b) lock/unlock the joints by script / maybe define the "hardness" or "springyness" of the joints by script or remote This could be done by hierarchical xml (in the ini) and the script interface could just expose these joint properties somehow(tm)
With such an object we could make all sorts of things from examination tables, sex machines to bondage devices.
|
Tue Feb 03, 2015 5:29 pm |
|
 |
rezzabae
Rank 14
Joined: Thu Aug 14, 2014 7:23 pm Posts: 156 Location: #0BADF00D - #FEED1337
|
I managed to get an rigged mechanical complex object to work by accident.... But it crashes on scene change or at leaving the game. While playing all works well atm, however.... I now have an working complex movable mechanical linked object with this rig: +root +movable +movable | +movable +movable | +movable +movable | +movable +movable | +movable + movable + movable Ok what i did: two(or more) rbi objects testobject.ma rb "base" { dynamic = true; ... link { kd = 10,0 } ... } rb "movable" { all that stuff from xpadmins post... } rbi "base" { } rbi "movable" { link { ref = "base"; } } create a maya scene with an object refernce to your testobject. in the scene.ini: dyn_object TEST { file_name = "scenes/test/baseShape.obj"; //Nope you do not need to define any other object one object of the testobjectsecene is enough... However.... } dyn_objecti:TEST TEST1 { obj_name ="testobject:movable"; << THIS IS WIERD you do not use the root node but any child WITHOUT childs! or the game crashes with scene_rb_object_link.cpp line224 Error at initializing the scene.... (have also seen other errors while brutforcing results^^) } I think you want to see anything but text: ( Remember its still a test object! Details after function  ) Attachment:
test212.png [ 1.19 MiB | Viewed 14372 times ]
Last edited by rezzabae on Tue Feb 03, 2015 6:31 pm, edited 1 time in total.
|
Tue Feb 03, 2015 6:18 pm |
|
 |
riftporn
Rank 16
Joined: Wed Aug 07, 2013 4:51 pm Posts: 315
|
And can you influence your joints by script? Like locking them or moving them?
|
Tue Feb 03, 2015 6:25 pm |
|
 |
rezzabae
Rank 14
Joined: Thu Aug 14, 2014 7:23 pm Posts: 156 Location: #0BADF00D - #FEED1337
|
It did not try that yet until now i use high friction values which serves quite well... i will head into scripting after i have found out what i is going wron on closing the programm or quiting/changing the scene...
EDIT: Atm i drag to movables around by hand, works well though
|
Tue Feb 03, 2015 6:34 pm |
|
 |
riftporn
Rank 16
Joined: Wed Aug 07, 2013 4:51 pm Posts: 315
|
Would you share that real ini? I'm having troubles with the instance objects....do they need seperate maya objects?
|
Tue Feb 03, 2015 9:04 pm |
|
 |
rezzabae
Rank 14
Joined: Thu Aug 14, 2014 7:23 pm Posts: 156 Location: #0BADF00D - #FEED1337
|
I am unable to figure out what is going wrong on closing the scene. I also still have the problem that i need to specify an object at the end of the hierarchy of the imported objects namespace in order to launch the scene... e.g.: Code: dyn_objecti TEST123 { //obj_name = "TEST123:RootObj"; <- Crashes //obj_name = "TEST123:Node1stLevelWithLeavesObj"; <- Crashes //obj_name = "TEST123:Node2ndLevelWithLeavesObj"; <- Crashes obj_name = "TEST123:Node2sndLevelWithoutLeavesObj"; //<- Works on loading, crashes at unloading the scene }
May i have a look on the code for instancing the pizzaBoxShape1 maybe its intended to use a Node below the root and the reason for the crash has something to do with perhaps buggy Meshes Code: dyn_objecti PIZZABOX { ???? }
EDIT: I have worked a little bit on the design, but it makes no sense to put more affort into the object until the crashing issue is solved... Attachment:
Unbenannt.png [ 2.1 MiB | Viewed 14293 times ]
|
Wed Feb 04, 2015 4:26 pm |
|
 |
|