예제 #1
0
        public override Particle emit(ParticleFactory particleFactory)
        {
            Vector3f tmp = new Vector3f(0.5f - random.NextDouble(), 0.5f - random.NextDouble(), 0.5f - random.NextDouble());
            tmp.Normalize();
            tmp.stretch(radius);
            tmp.add(position);

            return particleFactory.createParticle(tmp, false, null);
        }
예제 #2
0
        public GroundPlane(Texture texture, int tileU, int tileV, Vector3f pointA, Vector3f pointB, Vector3f pointC, Vector3f pointD)
        {
            this.texture = texture;

            this.tileU = tileU;
            this.tileV = tileV;

            this.pointA = pointA;
            this.pointB = pointB;
            this.pointC = pointC;
            this.pointD = pointD;

            Vector3f vectorA = pointA.diff(pointB);
            Vector3f vectorB = pointA.diff(pointD);

            normal = vectorA.Cross(vectorB);
            normal.Normalize();
        }