Hello everyone
I’m having a problem with Sprite3D clipping in Away3D 3.6 (tested both the official stable and the repository latest).
I’m using Sprite3D to create a simple particle effect. The sprites showup when using RectangularClipping (since it doesn’t really do anything), but won’t show up at all when using NearfieldClipping or FrustumClipping.
However, I got a few other sprites that are working perfectly! it’s just this particle effect..
I don’t mind using a quick hack to completely disable sprite clipping, I’m not using many anyway.
Here’s the problematic sprite class:
public class CFireSprite3D extends DirectionalSprite
{
protected var isAlive:Boolean = true;
protected var mOrigin:Vector3D;
protected var mDir:Vector2D;
protected var nRange:Number;
protected var nLifetime:Number = 1.0;
public function CFireSprite3D(material:Material, _width:Number, _height:Number, origin:Vector3D, xz_direction:Vector2D, range:Number)
{
super(material, _width, _height);
mOrigin = origin;
mDir = xz_direction;
nRange = range;
init();
}
protected function init():void
{
x = mOrigin.x;
y = mOrigin.y;
z = mOrigin.z;
scaling = 0.2;
BitmapMaterial(material).alpha = 0.2;
}
public function start():void
{
var ex:Number = mOrigin.x + (mDir.x * nRange);
var ez:Number = mOrigin.z + (mDir.y * nRange);
Tweener.addTween(this, { x:ex, z:ez, time:nLifetime, onComplete:end, transition:"linear" } );
Tweener.addTween(this, { scaling:1.5, time:nLifetime / 1.5, transition:"linear" } );
Tweener.addTween(BitmapMaterial(material), { alpha:0.6, time:nLifetime / 3, transition:"linear" } );
Tweener.addTween(BitmapMaterial(material), { alpha:0, delay:nLifetime * 0.73, time:nLifetime * 0.25, transition:"linear" } );
}
public function end():void
{
isAlive = false;
parent.removeSprite(this);
}
//////////////////////////////////////////////////// Accessors
public function get alive():Boolean
{
return isAlive;
}
}
Any help is appreciated