ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperCube > Help with CopperCube
forum topic indicator Physics engine problem
person icon
verybigooooooof
Registered User
Quote
2023-08-27 21:05:16

When I Use The Drag 3D Object Node While Using Physics Simulation The Object I Drag Ingame Starts To not Colliding With Objects Etc.
How To Fix that? emoji icon_sad

person icon
Dieter
Guest
Quote
2023-08-28 20:25:42

Did you try

ccbUpdatePhysicsGeometry();


You might set up a behavior that's executed whenever the position of a dragged object has changed, and then immediately call abovementioned function.

person icon
verybigooooooof
Registered User
Quote
2023-08-29 14:22:30

UR THE BEST!
Thank you so much it worked :D

person icon
verybigooooooof
Registered User
Quote
2023-08-29 15:18:24

when i clone the cube ingame the cloned one doesnt collide again :(

person icon
Dieter
Guest
Quote
2023-08-29 15:51:03

I remember when working with CopperLicht, I noticed clones do not inherit collision properties of the source. I managed to apply them by code, but that was only for the webGl target, as far as I remember. I doubt this works in directX or openGL exports:


// add a cube to test, invisible cube with collision

var cubenode = new CL3D.CubeSceneNode();
scene.getRootSceneNode().addChild(cubenode);

cubenode.Pos.Y=5;
cubenode.updateAbsolutePosition();
cubenode.Visible=false;

var TriangleSelectorOfCubeNode = new CL3D.MeshTriangleSelector(cubenode.getMesh(), cubenode);
MetaTriangleSelector = new CL3D.MetaTriangleSelector();

var colanimator = new CL3D.AnimatorCollisionResponse(
new CL3D.Vect3d(6,12,6), // size of the player ellipsoid
new CL3D.Vect3d(0,0,0), // position of the eye in the ellipsoid
MetaTriangleSelector);

colanimator.AffectedByGravity = false;

cam.addAnimator(colanimator);

// var TriangleSelectorOfCubeNode = new CL3D.MeshTriangleSelector(cubenode.getMesh(), cubenode);
MetaTriangleSelector.addSelector(TriangleSelectorOfCubeNode);



In any case, you may have to dig rather deep to make clones work with collision. Or maybe I'm wrong and there's some simple solution.

Did you try and see whether there's a difference between manually (in-editor) cloned meshes, and those cloned by script?

person icon
Dieter
Guest
Quote
2023-08-29 16:11:29

Oh btw, I see the above code contains "getMesh()", this doesn't work with the CC Version 6.4, that I use, and probably also not with the latest 6.6 version. But it worked in earlier versions, which is why I used an older version of copperlicht.js (you have to overwrite the one that CC exports into the copperlichtdata folder)
Case you're interested, that working copperlicht.js is part of the zip download of my recent game on itch.io, search for "the ouchee island ramification". Well, at least I think one can extract it from the zip. Else let me know.

But as you're using physics, they don't work in the webgl target anyway, so... no good advice here, sorry. Maybe somebody else has a good solution. Like, the real CC gurus.


Create reply:










 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






Copyright© Ambiera e.U. all rights reserved.
Contact | Imprint | Products | Privacy Policy | Terms and Conditions |