Raggar

Members
  • Content Count

    347
  • Joined

  • Last visited

  • Days Won

    1

Raggar last won the day on May 6 2018

Raggar had the most liked content!

2 Followers

About Raggar

  • Rank
    Advanced Member

Recent Profile Visitors

2,869 profile views
  1. It is discouraged to keep using this forum, instead create a thread at forum.babylonjs.com This seems to work: https://www.babylonjs-playground.com/#ASDN0P#2 I (think!) changing the transforms of a mesh only updates the boundingInfo, without creating a new one, so the reference bb1 gets updated as well, making both references bb1 and bb2 the same. Why the baking of transforms worked, I have no idea, but it seems to be needed in order to work in this example.
  2. Raggar

    New forum

    I gotta say, it saddens me to move from this forum I liked having some Phaser threads show up in the activity feed as well, even if I don't use Phaser myself. However, if Phaser is moving anyway, I'm on board with moving the BabylonJS activity elsewhere as well.
  3. I use the AssetsManager to load all my sounds, and put them into an array at predictable indexes. This way, I can clone the sounds and attach them to all players. /////Task var gunshotSound3 = assetsManager.addBinaryFileTask("soundTask3", "sounds/gs3.ogg"); /////onSuccess callback gunshotSound3.onSuccess = function (task){ var gs3 = new BABYLON.Sound("gunshotSound3", task.data, scene, null, { loop: false, autoplay: false, spatialSound: true }); sounds[2] = gs3; gs3.setVolume(0.6); } /////Player creation function player(gunIndex, ..., ..., ...){ ///gunIndex = 2; ... ...... ... ... this.gunSound = sounds[gunIndex].clone("gunSound"); this.gunSound.attachToMesh(this.mesh); } /////Gunshot sound needed player.gunSound.play(); /////New weapon etc. player.gunSound.dispose(); player.gunSound = null; player.gunSound = sounds[x].clone("gunSound");
  4. Raggar

    Demo with Ammo.js Physics Engine

    To my knowledge, cosserat rods are not supported out-of-the-box in Bullet Physics/AmmoJS. However, it seems like someone tried implementing it at some point:https://pybullet.org/Bullet/phpBB3/viewtopic.php?t=11242 Here's an Elastic Rod implementation as well: https://pybullet.org/Bullet/phpBB3/viewtopic.php?f=4&t=10993&p=36852 But these are all new concepts to me. If you want vehicle micro-destruction, Bullet provides you everything from the contact pairs, points, normals, applied impulses etc. So a vehicle-bone-rig would be cool with some swapping of models as well. You can create your vehicle body out of smaller shapes and use hinges on doors etc. Or you can simply use a model as cosmetics. You'll most likely use a compound body anyway, since it's the easiest way to create an artificially lowered center of mass. Would be cool to see a game like that.
  5. Raggar

    How to animate UniversalCamera's Target?

    Here's an example of the FreeCamera: https://www.babylonjs-playground.com/#XPCUMC Using the lockedTarget property. I think this might be your issue with the other cameras as well.
  6. Raggar

    3ds Max 2018 bones/skin problems

    I honestly have no idea. Your issue was different than mine. It was sort of a brute-force approach finding a solution.
  7. I'm using the bone functions getPositionToRef() and getRotationToRef() to sync hitboxes to bones. If you went down this path, you would help others using the Blender exporter as well You would have to somehow use the rotation in Blender to fix the rotation in BabylonJS, though, as as you say, the rotation in BabylonJS is different from that of Blender. I think the model in BabylonJS inherits the rotationQuaternion of the bone. You would either rotate the model/hitbox each frame, or take the difference from Blender and BabylonJS and apply this before attaching the model to the bone.
  8. Raggar

    Demo with Ammo.js Physics Engine

    Heightfields are generally more performant, but lacks features that concave shapes have. If you are creating a giant island-map, you'll want the extra performance of the heightfield, if all of the map is to be used for collision detection and dynamics. If you, however, want to create a racing track, a heightfield could result in A LOT of unused geometry in your physics shape. In this case a concave shape would be more performant, and allow for such features as holes in the ground, which heightfields do not. Generally, if you want dynamic concave shapes, you are way better off converting to/generating a compound body of convex shapes. It all really depends on your project, and there's no reason not to use both heightfield, concave, convex and primitive shapes all at once. You'll squeeze out some extra performance if you groups all static shape types together as well, making big compound bodies out of all static concave shapes, making compound bodies out of all static convex shapes, etc, etc. <- Same thing with CannonJS.
  9. In 3Ds Max, try changing the pivots for all the meshes to "Center to object". You can do this by simply selecting everything at once.
  10. Raggar

    3ds Max 2018 bones/skin problems

    I can't open your max file since I'm outdated at the 2015 version. Deleting the cloth fixed the artifacts for me, but another thing did as well. Can you confirm this works for you, too?: - Select the cloth mesh - In the skin modifier, remove all but the weighted bones, leaving you only with the backflap_.......... frontflap_... bones.
  11. Raggar

    3ds Max 2018 bones/skin problems

    I've had similar issues with Max. Back then the issue happened if a vertex wasn't weighted properly. A single non-weighted vertex would create artifacts. I haven't tested your file, but try weighting ALL vertices 100% to a single bone. If this solves the artifacts, you can be pretty sure that it's a weighting issue. Edit: My issue actually looked different. Will try it later tonight.
  12. Does .position and getAbsolutePosition() match? As Brian pointed out, it might very well be that the pivot points of the meshes are offset from 0,0,0. This can happen in the 3D-modeling software when you export, reset transforms etc. but is useless if you plan on animating the individual models. You can open your model in Blender, or use BabylonJS to change the pivots to the center of the different meshes.
  13. Raggar

    Demo with Ammo.js Physics Engine

    I recently ported the physics engine of an "old-ish" BabylonJS project of mine from CannonJS to AmmoJS. I did this as CannonJS is no longer maintained, has buggy convex collisions and a limited concave implementation. AmmoJS can be compiled to WASM as well, which is no doubt the way things are moving when it comes to physics. Chrome even just started their trial for WASM threads. I'm using a worker, though, as my game requires every bit of juice it can possibly get. I won't have time to help with the plugin, and you know.... What is TypeScript? .. But I really think AmmoJS should be included as a plugin, as well as the playground, as it is a beast. Just make sure to re-use quaternions, vectors, transforms etc. as AmmoJS otherwise leaks and builds up memory pretty fast. I think a proper implementation will be far superior to what BabylonJS already supports.
  14. Raggar

    Rotating cloned imported mesh

    https://playground.babylonjs.com/indexStable.html#PN1NNI#98 In the exporter - at least the one for Max, models are exported with the rotationQuaternion property set. When this is the case, .rotation is not used. Either null out the rotationQuaternion, or rotate the model/clone using one of the methods that supports quaternion rotations.
  15. Raggar

    I Love This Forum

    Ask him when we'll see him aboard the Orville