当前位置: 首页>>代码示例>>C#>>正文


C# Point3F.vecotrScale方法代码示例

本文整理汇总了C#中WinterLeaf.Containers.Point3F.vecotrScale方法的典型用法代码示例。如果您正苦于以下问题:C# Point3F.vecotrScale方法的具体用法?C# Point3F.vecotrScale怎么用?C# Point3F.vecotrScale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WinterLeaf.Containers.Point3F的用法示例。


在下文中一共展示了Point3F.vecotrScale方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ShapeBaseTossPatch

        public string ShapeBaseTossPatch(coShapeBase thisobj)
            {
            if (!thisobj.isObject())
                return string.Empty;

            coItem item = console.Call_Classname("ItemData", "CreateItem", new[] {"HealthKitPatch"});
            item["istemp"] = true.AsString();

            item["sourceObject"] = thisobj;
            item["static"] = false.AsString();

            (( coSimSet)"MissionCleanup").pushToBack(item);

            Random r = new Random();

            Point3F vec = new Point3F(-1 + (float) r.NextDouble()*2, -1*(float) r.NextDouble()*2, (float) r.NextDouble());
            vec = vec.vecotrScale(10);
            Point3F eye = thisobj.getEyeVector();
            float dot = new Point3F("0 0 1 ").vectorDot(eye);
            if (dot < 0)
                dot = -dot;

            vec = vec + new Point3F("0 0 8").vecotrScale(1 - dot);
            vec = vec + thisobj.getVelocity();

            TransformF pos = new TransformF(thisobj.getWorldBox().minExtents);
            item.setTransform(pos);
            item.applyImpulse(pos.MPosition, vec);
            item.setCollisionTimeout(thisobj);

            item.call("schedulePop");

            return item;
            }
开发者ID:RichardRanft,项目名称:DNT-Torque3D-V1.1,代码行数:34,代码来源:Health.cs

示例2: ShapeBaseTossPatch

        public string ShapeBaseTossPatch(string thisobj)
            {
            if (!console.isObject(thisobj))
                return string.Empty;

            string item = console.Call_Classname("ItemData", "CreateItem", new[] {"HealthKitPatch"});
            console.SetVar(item + ".istemp", true);
            //string item = con.Eval("ItemData::CreateItem(HealthKitPatch);", true);
            console.SetVar(string.Format("{0}.sourceObject", item), thisobj);
            console.SetVar(string.Format("{0}.static", item), false);
            SimSet.pushToBack("MissionCleanup", item);

            Random r = new Random();

            Point3F vec = new Point3F(-1 + (float) r.NextDouble()*2, -1*(float) r.NextDouble()*2, (float) r.NextDouble());
            vec = vec.vecotrScale(10);
            Point3F eye = ShapeBase.getEyeVector(thisobj);
            float dot = new Point3F("0 0 1 ").vectorDot(eye);
            if (dot < 0)
                dot = -dot;

            vec = vec + new Point3F("0 0 8").vecotrScale(1 - dot);
            vec = vec + ShapeBase.getVelocity(thisobj);

            TransformF pos = new TransformF(SceneObject.getWorldBox(thisobj).minExtents);
            SceneObject.setTransform(item, pos);
            ShapeBase.applyImpulse(item, pos.MPosition, vec);
            Item.setCollisionTimeout(item, thisobj.AsInt());
            console.Call(item, "schedulePop");
            return item;
            }
开发者ID:Winterleaf,项目名称:DNT-Torque3D-V1.0,代码行数:31,代码来源:Health.cs


注:本文中的WinterLeaf.Containers.Point3F.vecotrScale方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。