# Outerra forum

• November 24, 2020, 08:38:17 pm
• Welcome, Guest

### News:

Pages: 1 [2] 3 4 5

### AuthorTopic: Methods  (Read 32283 times)

#### SteelRat

• Sr. Member
• Posts: 380
• newbie
##### Re: Methods
« Reply #15 on: July 12, 2015, 10:43:33 am »

It's a placeholder function, does nothing yet.

I'm understood, thank you.
Logged

#### SteelRat

• Sr. Member
• Posts: 380
• newbie
##### Re: Methods
« Reply #16 on: November 12, 2015, 07:09:01 pm »

Hi cameni!

Code: [Select]
`this.geom = this.get_geomob(0);var bone = this.geom.get_joint("bone_1");var angle = Math.random()*3.14;this.geom.rotate_joint_orig(bone, angle, {x:0,y:1,z:0});var boneAngle = // How get rotate joint "bone"?`
Logged

#### SteelRat

• Sr. Member
• Posts: 380
• newbie
##### Re: Methods
« Reply #17 on: November 12, 2015, 07:24:27 pm »

PS
http://xtrac.outerraworld.com/wiki/geomob

Code: [Select]
`getOwnPropertyNames: geomob(0)get_pos,get_rot,get_inst_id,get_pos_offset,get_scale,set_scale,set_pos,move,set_rot,add_rot,remove_from_scene,get_obb_offset,get_obb_hvec,get_eid,set_custom_data,get_custom_data,get_joint,get_mesh_id,set_joint_visible,reset_joint,rotate_joint,rotate_joint_orig,move_joint,move_joint_orig,set_mesh_visible,set_mesh_visible_id,get_joint_model_pos,get_joint_local_pos,deselect,load_animation,set_animate_mode,animate,set_skeleton_weight,get_animation_stack,set_visible,set_visible_on_slave,is_visible,is_ready,get_bone_model_tm,get_bone_local_tm,get_bone_bind_pose_tm,get_meshes,get_lods,get_collision_meshes,get_mesh_flags,attach_to,get_world_transform,dump_geom_info,\$query_interface,\$rebind_events,\$ctx`
Logged

#### SteelRat

• Sr. Member
• Posts: 380
• newbie
##### Re: Methods
« Reply #18 on: November 13, 2015, 01:09:02 pm »

Hi cameni!

Code: [Select]
`this.geom = this.get_geomob(0);var bone = this.geom.get_joint("bone_1");var angle = Math.random()*3.14;this.geom.rotate_joint_orig(bone, angle, {x:0,y:1,z:0});var boneAngle = // How get rotate joint "bone"?`

Code: [Select]
`this.geom = this.get_geomob(0);var bone = this.geom.get_joint("bone_1");this.geom.rotate_joint_orig(bone, Math.random()*3.14, {x:0,y:1,z:0});...var bone_\$ret = this.geom.get_bone_local_tm(bone).\$ret;this.log_inf("get_bone_local_tm: \$ret: " + JSON.stringify(bone_\$ret));// get_bone_local_tm: \$ret: truevar bone_pos = this.geom.get_bone_local_tm(bone).pos;this.log_inf("get_bone_local_tm: pos: " + JSON.stringify(bone_pos));// get_bone_local_tm: pos: {"x":0.04446744918823242,"y":0.3633822202682495,"z":1.1257092952728271}var bone_rot = this.geom.get_bone_local_tm(bone).rot;this.log_inf("get_bone_local_tm: rot: " + JSON.stringify(bone_rot));// get_bone_local_tm: rot: {"x":0,"y":0.585388720035553,"z":0,"w":-0.8107527494430542}`
PS
RU
Грустно всё это
Возвращаемый методом результат статичен, не учитываются внесённые изменения позиции и углов поворота кости.
« Last Edit: November 13, 2015, 03:28:48 pm by SteelRat »
Logged

#### SteelRat

• Sr. Member
• Posts: 380
• newbie
##### Re: Methods
« Reply #19 on: December 31, 2015, 09:57:49 am »

Hi cameni!

Code: [Select]
`var mtm = this.geom.get_bone_model_tm(this.point_gun_l_fire);var firePos = mtm.pos;var fireDir = // how to convert mtm.rot -> float3 dir - model-space direction of firing;this.fire(firePos, fireDir, 800, 0.23, {x:1,y:.8});`
Logged

#### cameni

• Brano Kemen
• Hero Member
• Posts: 6700
• No sense of urgency.
##### Re: Methods
« Reply #20 on: December 31, 2015, 02:28:35 pm »

rot is a quaternion, and if you want the direction of +y axis (the forward axis in model space), then you'd multiply rot * float3(0,1,0), which can be simplified in JS to:

Code: [Select]
`fireDir = {x: 2 * (rot.x*rot.y - rot.w*rot.z),y: 1 - 2*(rot.x*rot.x + rot.z*rot.z),z: 2 * (rot.y*rot.z + rot.w*rot.x)}`
Logged

#### SteelRat

• Sr. Member
• Posts: 380
• newbie
##### Re: Methods
« Reply #21 on: December 31, 2015, 03:29:38 pm »

Thank you!
Logged

#### SteelRat

• Sr. Member
• Posts: 380
• newbie
##### Re: Methods
« Reply #22 on: January 09, 2016, 07:10:22 pm »

Hi cameni!

Code: [Select]
`this.get_wheel_param();this.set_wheel_param();`
arguments?
Logged

#### cameni

• Brano Kemen
• Hero Member
• Posts: 6700
• No sense of urgency.
##### Re: Methods
« Reply #23 on: January 10, 2016, 03:04:52 am »

Code: [Select]
`    //@param wheel wheel id    //@param name one of suspension_max, suspension_min, suspension_stiffness, damping_compression, damping_relaxation, slip, slip_lateral_coef    //@return wheel param value    float get_wheel_param( int wheel, stringtoken name ) const;    //@param wheel wheel id, -1 all wheels, -2 first two wheels    //@param name one of suspension_max, suspension_min, suspension_stiffness, damping_compression, damping_relaxation, slip, slip_lateral_coef    //@param value value to set    void set_wheel_param( int wheel, stringtoken name, float value );`
Logged

#### SteelRat

• Sr. Member
• Posts: 380
• newbie
##### Re: Methods
« Reply #24 on: January 10, 2016, 09:14:28 am »

Code: [Select]
`    //@param wheel wheel id    //@param name one of suspension_max, suspension_min, suspension_stiffness, damping_compression, damping_relaxation, slip, slip_lateral_coef    //@return wheel param value    float get_wheel_param( int wheel, stringtoken name ) const;    //@param wheel wheel id, -1 all wheels, -2 first two wheels    //@param name one of suspension_max, suspension_min, suspension_stiffness, damping_compression, damping_relaxation, slip, slip_lateral_coef    //@param value value to set    void set_wheel_param( int wheel, stringtoken name, float value );`

Thanks!

RU
Теперь я понял причину не удачи, ход моей мысли был правильный.
Но я запрашивал параметр radius, мне возвращался NULL. Мне стоило опросить другие параметры).
Но такое положение завело меня в тупик, мне нужно управлять параметром radius, что бы решить эту задачу.

PS
I have an idea! How to solve.
« Last Edit: January 10, 2016, 09:37:32 am by SteelRat »
Logged

#### HiFlyer

• Hero Member
• Posts: 1779
• newbie
##### Re: Methods
« Reply #25 on: January 10, 2016, 09:58:17 am »

I saw a problem similar to this when looking at some stuff about Bullet boat physics. It had a suggestion about invisible attachments that had specific weight and gravity parameters to keep an object at a predetermined angle..... (not sure if that helps)
Logged
Spex: Intel Core i7 6700K @ 4.6GHz / 32.0GB G.SKILL TridentZ Series Dual-Channel Ram / ASUS STRIX GeForce GTX 1080 / Sound Blaster Z / Oculus Rift VR Headset / Klipsch® Promedia 2.1 Computer Speakers / ASUS ROG SWIFT PG279Q ‑ 27" IPS LED Monitor ‑ QHD / 2x Samsung SSD 850 EVO 500GB / Windows 10 Pro

#### SteelRat

• Sr. Member
• Posts: 380
• newbie
##### Re: Methods
« Reply #26 on: January 10, 2016, 11:13:57 am »

I saw a problem similar to this when looking at some stuff about Bullet boat physics. It had a suggestion about invisible attachments that had specific weight and gravity parameters to keep an object at a predetermined angle..... (not sure if that helps)

Like today operates a ground vehicle simulations. That is, the wheel itself should not be a mesh.
Logged

#### SteelRat

• Sr. Member
• Posts: 380
• newbie
##### Re: Methods
« Reply #27 on: January 10, 2016, 11:18:59 am »

Quote
PS
I have an idea! How to solve.

RU
Моя идея оказалась верной, но принесла с собой другую проблему.
Я понимаю что можно создать дубли сеток колёс, и в зависимости от состояния шасси скрывать одни и показывать другие.
Но по мне такая реализация выглядит как костыли(medical term), и мне совсем не нравятся подобные реализации.

Logged

#### SteelRat

• Sr. Member
• Posts: 380
• newbie
##### Re: Methods
« Reply #28 on: January 10, 2016, 02:57:54 pm »

Hi cameni!

Code: [Select]
`this.geom.attach_to()`
arguments?
Logged

• Brano Kemen