≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
[BUG?] camera update latency with foreign behaviour
Posted by:
(you are not logged in)
Enter the missing letter in: "Internat?onal"
(you are not logged in)
Text:
[quote][b]elmigo[/b] wrote: i have behavior that get keys and move selected object in my examle, selected object of behavior is active camera if behavior attached to camera which selected then moving is smooth if behavior attached to any other object then when behavior move camera then camera moving with shaking if camera has child then when moving is child yet more laggy for example, hand is break away with move to back [img]http://joxi.ru/EA4oOaxFwEbOP2.jpg[/img] [code] behavior_CursorMove.prototype.onAnimate = function(node, timeMs) { if (this.LastTime == null) { this.LastTime = timeMs; return false; } var timeDiff = timeMs - this.LastTime; this.LastTime = timeMs; if (timeDiff > 200) timeDiff = 200; var pos = ccbGetSceneNodeProperty(this.Object, 'Position'); var trg = ccbGetSceneNodeProperty(this.Object, 'Target'); var isMove = false; if (this.keyUp) {isMove = true; this.calcDirFwd(pos, trg);} else if (this.keyDown) {isMove = true; this.calcDirBack(pos, trg);} if (this.keyLeft) {isMove = true; this.calcDirLeft(pos, trg);} else if (this.keyRight) {isMove = true; this.calcDirRight(pos, trg);} if (isMove) { var speed = this.Speed * timeDiff; pos.x += this.dir.x * speed; pos.y += this.dir.y * speed; pos.z += this.dir.z * speed; trg.x += this.dir.x * speed; trg.y += this.dir.y * speed; trg.z += this.dir.z * speed; } ccbSetSceneNodeProperty(this.Object, 'Target', trg); ccbSetSceneNodeProperty(this.Object, 'Position', pos); return true; } [/code][/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