System.Collections.Generic.ICollection.Add(Vector4)

Here are the examples of the csharp api System.Collections.Generic.ICollection.Add(Vector4) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

19 Source : Camera.cs
with GNU Lesser General Public License v2.1
from axiom3d

[OgreVersion(1, 7, 2790)]
        public virtual void ForwardIntersect(Plane worldPlane, IList<Vector4> intersect3D)
        {
            if (intersect3D == null)
            {
                return;
            }

            var trCorner = WorldSpaceCorners[0];
            var tlCorner = WorldSpaceCorners[1];
            var blCorner = WorldSpaceCorners[2];
            var brCorner = WorldSpaceCorners[3];

            // need some sort of rotation that will bring the plane normal to the z axis
            var pval = worldPlane;
            if (pval.Normal.z < 0.0)
            {
                pval.Normal *= -1.0;
                pval.D *= -1.0;
            }
            var invPlaneRot = pval.Normal.GetRotationTo(Vector3.UnitZ);

            var vec = new Vector3[4];

            // get rotated light
            var lPos = invPlaneRot * DerivedPosition;
            vec[0] = invPlaneRot * trCorner - lPos;
            vec[1] = invPlaneRot * tlCorner - lPos;
            vec[2] = invPlaneRot * blCorner - lPos;
            vec[3] = invPlaneRot * brCorner - lPos;

            var iPnt = GetRayForwardIntersect(lPos, vec, -pval.D);

            // return wanted data
            //if (intersect3D != null) // cant be null
            {
                var planeRot = invPlaneRot.Inverse();
                intersect3D.Clear();
                foreach (var v in iPnt)
                {
                    var intersection = planeRot * new Vector3(v.x, v.y, v.z);
                    intersect3D.Add(new Vector4(intersection.x, intersection.y, intersection.z, v.w));
                }
            }
        }

19 Source : OceanFoamAreaEditor.cs
with MIT License
from JiongXiaGu

private void Add(ICollection<Vector4> result, int x, int y, Vector2 offset, float factor)
        {
            result.Add(new Vector4(x * offset.x, y * offset.y, factor));
        }