Beispiel #1
0
        public void SetEffectMatrix(SCN0Node node, ModelPanelViewport v, float frame)
        {
            if (MapMode != MappingMethod.TexCoord)
            {
                switch (MapMode)
                {
                case MappingMethod.Projection:
                    _effectMatrix = Matrix34.ProjectionMapping(SCN0RefCamera, node, v, frame);
                    break;

                case MappingMethod.EnvSpec:
                    _effectMatrix = Matrix34.EnvSpecMap(SCN0RefCamera, SCN0RefLight, node, v, frame);
                    break;

                case MappingMethod.EnvLight:
                    _effectMatrix = Matrix34.EnvLightMap(SCN0RefLight, node, v, frame);
                    break;

                case MappingMethod.EnvCamera:
                    _effectMatrix = Matrix34.EnvCamMap(SCN0RefCamera, node, v, frame);
                    break;

                default:
                    _effectMatrix = Matrix.Identity;
                    break;
                }
            }
            else
            {
                _effectMatrix = Matrix.Identity;
            }
        }
        public void AttachNodes()
        {
            SCN0Node      node    = (SCN0Node)Parent.Parent;
            SCN0GroupNode g       = node.GetFolder <SCN0LightNode>();
            bint *        strings = Data->StringOffsets;

            if (g != null && !_replaced)
            {
                for (int i = 0; i < Data->_numLights && i < 8; i++)
                {
                    _lights[i] = g.FindChild(new String((sbyte *)strings + strings[i]), false) as SCN0LightNode;
                }
            }
            g = node.GetFolder <SCN0AmbientLightNode>();
            if (g != null && Data->_ambNameOffset != 0 && !_replaced)
            {
                _ambient = g.FindChild(Data->AmbientString, false) as SCN0AmbientLightNode;
            }
        }