當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。