≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
createClone() problems - still
Posted by:
(you are not logged in)
Enter the missing letter in: "?nternational"
(you are not logged in)
Text:
[quote][b]csp-games[/b] wrote: First of all, I unsuccessfully tried to find the answer in this forum and elsewhere for a few hours, so I dare to ask. For now the simple goal is to clone a ccbz-loaded mesh, position it somewhere, and have collision working like with the original. I do this (on a keyhit): [code] // find entity var mytree=ccbGetSceneNodeFromName("my_pinetree1"); // entityxyz var myvec=cam.getAbsolutePosition(); myvec.X+=20; myvec.Y+=20; //positionentity mytree.Pos=myvec; mytree.updateAbsolutePosition(); //copyentity var mytree2=mytree.createClone(scene.getRootSceneNode(),mytree.Id,mytree.Id+100); // scene.getRootSceneNode().addChild(mytree2);// makes no difference, I assume a clone is added to the parent of the original anyway? mytree2.Name="bubu"; //mytree2.init();// just scales it to 1,1,1 var myvec2=myvec; myvec2.Y-=40; mytree2.Pos=myvec2; mytree2.updateAbsolutePosition(); [/code] Now what happens is: I hit space the 1st time, there's a tree at the myvec2 position, but the original tree has disappeared. This new one has working collision. I move the cam and hit space again, there's a new tree, but the other one is still there, so I really cloned it. But the new one has collision, and the old one has not. I move and hit space again, there's a third tree, with collision, but the other 2 old ones have no collision now. This keeps on, and the last one is always the only one that has collision response. Can somebody point me out in simple code, how to achieve my goal, or if it's not possible, admit it and help me stop wasting time? I've seen Niko's function to overwrite the createClone function, but AFAIS, as it creates a mesh from scratch, it won't have working collision - at least I never managed to get collision to work with a cusom made mesh node. I actually abandoned a working mesh loader because I couldn't get collision to work. I add here further questions, that somebody may be capable to answer: How can I get collision to work with a mesh that is made by code. What's the deal with the whole Selector business. How can I linepick an animated mesh. I can do it on a static one, based on one of the tutorials. However, shooting targets are usually animated. Is it possible to use BLOOM etc. with direct copperlicht.js use? I tried those constants, never worked. If this is some kind of limit in the free, open source version, not just because of the apocalypse etc., I would recc to enable it for everybody. Growth is everything, if you want to play the engine game. There's a huge engine graveyard. Don't waste the potential of CL. I imported a B3D mesh in ccube, with masked textures. This is not alpha, but 1 bit masking (directx, probably webGL too?). In ccube it uses alpha. The z-order of the tris is unsorted. Can this be fixed? I noticed there is sorting for seperate nodes. The editor supports masked dds textures (tho using alpha blending), when run in the browser, it's solid (may be the browser). Can dynamic lights put shadows on a lightmapped mesh? Maybe on a clone in some blend mode? I leave it at that, thanks.[/quote]
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
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact