本文整理汇总了C#中SceneObject类的典型用法代码示例。如果您正苦于以下问题:C# SceneObject类的具体用法?C# SceneObject怎么用?C# SceneObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SceneObject类属于命名空间,在下文中一共展示了SceneObject类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: InstanceEntity
/// <summary>
/// Creates a new instance of the InstanceEntity
/// </summary>
/// <param name = "name">The name of the instance</param>
/// <param name = "index">The index used in the SceneObject.SkinBones array</param>
/// <param name = "sceneObject">The SceneObject this instance pertains to</param>
/// <param name = "transform">The matrix used to place the instance in the world</param>
protected internal InstanceEntity(string name, int index, SceneObject sceneObject, Matrix transform)
: base(name, false)
{
Index = index;
Parent = sceneObject;
World = transform;
}
开发者ID:Indiefreaks,项目名称:igf,代码行数:14,代码来源:InstanceEntity.cs
示例2: SceneInfo
/// <summary>
/// Initializes a new instance of the <see cref="WhatPumpkin.SceneInfo"/> class.
/// I'm using this constructor primarily for receiving save/load data.
/// </summary>
/// <param name="key">Key.</param>
/// <param name="sceneObjects">Scene objects.</param>
/*
public SceneInfo(string key, IEnumerable sceneObjects) {
_key = key;
}*/
/// <summary>
/// Initializes a new instance of the <see cref="WhatPumpkin.SceneInfo"/> class.
/// </summary>
/// <param name="key">Key.</param>
public SceneInfo(string key) {
_key = key;
// TODO: Abstract this data
foreach (Entity entity in GameObject.FindObjectsOfType<Entity>()) {
ISceneObject<string> item = (ISceneObject<string>)entity;
if (item != null) {
try {
SceneObject sceneObject = new SceneObject ();
_sceneObjects.Add (sceneObject);
sceneObject.ReceiveData(item);
} catch (System.Exception e) {
Debug.LogException(e);
}
}
}
}
开发者ID:SuperAnthony,项目名称:AdventureSpace1999,代码行数:44,代码来源:SceneInfo.cs
示例3: CloneSO
/// <summary>
/// Creates new a scene object by cloning an existing object.
/// </summary>
/// <param name="so">Scene object to clone.</param>
/// <param name="description">Optional description of what exactly the command does.</param>
/// <returns>Cloned scene object.</returns>
public static SceneObject CloneSO(SceneObject so, string description = "")
{
if (so != null)
return Internal_CloneSO(so.GetCachedPtr(), description);
return null;
}
开发者ID:Ruu,项目名称:BansheeEngine,代码行数:13,代码来源:UndoRedo.cs
示例4: ApplyPrefab
/// <summary>
/// Updates the contents of the prefab with the contents of the provided prefab instance. If the provided object
/// is not a prefab instance nothing happens.
/// </summary>
/// <param name="obj">Prefab instance whose prefab to update.</param>
/// <param name="refreshScene">If true, all prefab instances in the current scene will be updated so they consistent
/// with the newly saved data.</param>
public static void ApplyPrefab(SceneObject obj, bool refreshScene = true)
{
if (obj == null)
return;
SceneObject prefabInstanceRoot = GetPrefabParent(obj);
if (prefabInstanceRoot == null)
return;
if (refreshScene)
{
SceneObject root = Scene.Root;
if (root != null)
Internal_RecordPrefabDiff(root.GetCachedPtr());
}
string prefabUUID = GetPrefabUUID(prefabInstanceRoot);
string prefabPath = ProjectLibrary.GetPath(prefabUUID);
Prefab prefab = ProjectLibrary.Load<Prefab>(prefabPath);
if (prefab != null)
{
IntPtr soPtr = prefabInstanceRoot.GetCachedPtr();
IntPtr prefabPtr = prefab.GetCachedPtr();
Internal_ApplyPrefab(soPtr, prefabPtr);
ProjectLibrary.Save(prefab);
}
if (refreshScene)
{
SceneObject root = Scene.Root;
if (root != null)
Internal_UpdateFromPrefab(root.GetCachedPtr());
}
}
开发者ID:BearishSun,项目名称:BansheeEngine,代码行数:42,代码来源:PrefabUtility.cs
示例5: Objekte
public Objekte(SceneObject Objekt, int Lebenspunkte, String Material)
{
objekt = Objekt;
lebenspunkte = Lebenspunkte;
setMaterial(Material);
}
开发者ID:ClemensTechmer,项目名称:Projektpraktikum.Multimedia.CrazyCastleCrush,代码行数:7,代码来源:Objekte.cs
示例6: NativeRigidbody
public NativeRigidbody(SceneObject linkedSO)
{
IntPtr linkedSOPtr = IntPtr.Zero;
if (linkedSO != null)
linkedSOPtr = linkedSO.GetCachedPtr();
Internal_CreateInstance(this, linkedSOPtr);
}
开发者ID:Ruu,项目名称:BansheeEngine,代码行数:8,代码来源:NativeRigidbody.cs
示例7: IsPrefabInstance
/// <summary>
/// Checks if a scene object has a prefab link. Scene objects with a prefab link will be automatically updated
/// when their prefab changes in order to reflect its changes.
/// </summary>
/// <param name="obj">Scene object to check if it has a prefab link.</param>
/// <returns>True if the object is a prefab instance (has a prefab link), false otherwise.</returns>
public static bool IsPrefabInstance(SceneObject obj)
{
if (obj == null)
return false;
IntPtr objPtr = obj.GetCachedPtr();
return Internal_HasPrefabLink(objPtr);
}
开发者ID:Ruu,项目名称:BansheeEngine,代码行数:14,代码来源:PrefabUtility.cs
示例8: NativeRenderable
public NativeRenderable(SceneObject sceneObject)
{
IntPtr sceneObjPtr = IntPtr.Zero;
if (sceneObject != null)
sceneObjPtr = sceneObject.GetCachedPtr();
Internal_Create(this, sceneObjPtr);
}
开发者ID:Ruu,项目名称:BansheeEngine,代码行数:8,代码来源:NativeRenderable.cs
示例9: SerializedSceneObject
/// <summary>
/// Records the current state of the provided scene object.
/// </summary>
/// <param name="so">Scene object to record the state for.</param>
/// <param name="hierarchy">If true, state will be recorded for the scene object and all of its children. Otherwise
/// the state will only be recorded for the provided scene object.</param>
public SerializedSceneObject(SceneObject so, bool hierarchy)
{
IntPtr soPtr = IntPtr.Zero;
if (so != null)
soPtr = so.GetCachedPtr();
Internal_CreateInstance(this, soPtr, hierarchy);
}
开发者ID:BearishSun,项目名称:BansheeEngine,代码行数:14,代码来源:SerializedSceneObject.cs
示例10: GetPrefabParent
/// <summary>
/// Returns the root object of the prefab instance that this object belongs to, if any.
/// </summary>
/// <param name="obj">Scene object to retrieve the prefab parent for.</param>
/// <returns>Prefab parent of the provided object, or null if the object is not part of a prefab instance.</returns>
public static SceneObject GetPrefabParent(SceneObject obj)
{
if (obj == null)
return null;
IntPtr objPtr = obj.GetCachedPtr();
return Internal_GetPrefabParent(objPtr);
}
开发者ID:Ruu,项目名称:BansheeEngine,代码行数:13,代码来源:PrefabUtility.cs
示例11: BreakPrefab
/// <summary>
/// Breaks the link between a prefab instance and its prefab. Object will retain all current values but will
/// no longer be influenced by modifications to its parent prefab.
/// </summary>
/// <param name="obj">Prefab instance whose link to break.</param>
public static void BreakPrefab(SceneObject obj)
{
if (obj == null)
return;
IntPtr objPtr = obj.GetCachedPtr();
Internal_BreakPrefab(objPtr);
}
开发者ID:Ruu,项目名称:BansheeEngine,代码行数:13,代码来源:PrefabUtility.cs
示例12: Form_Load
private void Form_Load(object sender, EventArgs e)
{
{
var camera = new Camera(
new vec3(0, 0, 5), new vec3(0, 0, 0), new vec3(0, 1, 0),
CameraType.Perspecitive, this.glCanvas1.Width, this.glCanvas1.Height);
var rotator = new SatelliteManipulater();
rotator.Bind(camera, this.glCanvas1);
this.scene = new Scene(camera, this.glCanvas1);
this.scene.RootViewPort.ClearColor = Color.SkyBlue;
this.glCanvas1.Resize += this.scene.Resize;
}
{
const int gridsPer2Unit = 20;
const int scale = 2;
var ground = GroundRenderer.Create(new GroundModel(gridsPer2Unit * scale));
ground.Scale = new vec3(scale, scale, scale);
var obj = new SceneObject();
obj.Renderer = ground;
this.scene.RootObject.Children.Add(obj);
}
{
SimpleRenderer movableRenderer = SimpleRenderer.Create(new Teapot());
movableRenderer.RotationAxis = new vec3(0, 1, 0);
movableRenderer.Scale = new vec3(0.1f, 0.1f, 0.1f);
this.movableRenderer = movableRenderer;
SceneObject obj = movableRenderer.WrapToSceneObject();
this.scene.RootObject.Children.Add(obj);
}
{
BillboardRenderer billboardRenderer = BillboardRenderer.Create(new BillboardModel());
SceneObject obj = billboardRenderer.WrapToSceneObject(new UpdateBillboardPosition(movableRenderer));
this.scene.RootObject.Children.Add(obj);
}
{
LabelRenderer labelRenderer = LabelRenderer.Create();
labelRenderer.Text = "Teapot - CSharpGL";
SceneObject obj = labelRenderer.WrapToSceneObject(new UpdateLabelPosition(movableRenderer));
this.scene.RootObject.Children.Add(obj);
}
{
var uiAxis = new UIAxis(AnchorStyles.Left | AnchorStyles.Bottom,
new Padding(3, 3, 3, 3), new Size(128, 128));
this.scene.RootUI.Children.Add(uiAxis);
}
{
var frmPropertyGrid = new FormProperyGrid(this.scene);
frmPropertyGrid.Show();
}
{
var frmPropertyGrid = new FormProperyGrid(this.glCanvas1);
frmPropertyGrid.Show();
}
{
this.scene.Start();
}
}
开发者ID:bitzhuwei,项目名称:CSharpGL,代码行数:57,代码来源:Form12Billboard.Load.cs
示例13: delWatcher
public void delWatcher(SceneObject obj)
{
for(int i=0; i<watcherobjs.Count; i++)
{
if(watcherobjs[i] == obj){
watcherobjs.RemoveAt(i);
return;
}
}
}
开发者ID:GamesDesignArt,项目名称:kbengine_unity3d_warring,代码行数:10,代码来源:LoadAssetsPool.cs
示例14: Initialize
public override void Initialize()
{
base.Initialize();
this.SO = new SceneObject(((ReadOnlyCollection<ModelMesh>)ResourceManager.GetModel("Model/SpaceObjects/planet_" + (object)this.moonType).Meshes)[0]);
this.SO.ObjectType = ObjectType.Static;
this.SO.Visibility = ObjectVisibility.Rendered;
this.WorldMatrix = ((Matrix.Identity * Matrix.CreateScale(this.scale)) * Matrix.CreateTranslation(new Vector3(this.Position, 2500f)));
this.SO.World = this.WorldMatrix;
base.Radius = this.SO.ObjectBoundingSphere.Radius * this.scale * 0.65f;
}
开发者ID:castroev,项目名称:StardriveBlackBox-verRadicalElements-,代码行数:10,代码来源:Moon.cs
示例15: Scene
public Scene(Window window)
{
this.window = window;
eventManager = new EventManager(this);
SetupEventSystems();
rootSceneObject = new SceneObject("Root", this);
}
开发者ID:KurtLoeffler,项目名称:EnvyEngine,代码行数:10,代码来源:Scene.cs
示例16: ProjectTop
public static void ProjectTop(SceneObject obj)
{
obj.rebuild();
Vector min = obj.Min();
Vector max = obj.Max();
float du = 1 / (max.X - min.X);
float dv = 1 / (max.Z - min.Z);
for (int i = 0; i < obj.vertices; i++)
{
obj.vertex[i].Tu = (obj.vertex[i].pos.X - min.X) * du;
obj.vertex[i].Tv = (obj.vertex[i].pos.Z - min.Z) * dv;
}
}
开发者ID:tgjones,项目名称:idx3dsharp,代码行数:13,代码来源:TextureProjector.cs
示例17: ProjectCylindric
public static void ProjectCylindric(SceneObject obj)
{
obj.rebuild();
Vector min = obj.Min();
Vector max = obj.Max();
float dz = 1 / (max.Z - min.Z);
for (int i = 0; i < obj.vertices; i++)
{
obj.vertex[i].pos.BuildCylindric();
obj.vertex[i].Tu = obj.vertex[i].pos.Theta / (2 * 3.14159265f);
obj.vertex[i].Tv = (obj.vertex[i].pos.Z - min.Z) * dz;
}
}
开发者ID:tgjones,项目名称:idx3dsharp,代码行数:13,代码来源:TextureProjector.cs
示例18: GUIFieldSelector
/// <summary>
/// Creates a new GUIFieldSelector and registers its GUI elements in the provided layout.
/// </summary>
/// <param name="layout">Layout into which to add the selector GUI hierarchy.</param>
/// <param name="so">Scene object to inspect the fields for.</param>
/// <param name="width">Width of the selector area, in pixels.</param>
/// <param name="height">Height of the selector area, in pixels.</param>
public GUIFieldSelector(GUILayout layout, SceneObject so, int width, int height)
{
rootSO = so;
scrollArea = new GUIScrollArea();
scrollArea.SetWidth(width);
scrollArea.SetHeight(height);
layout.AddElement(scrollArea);
GUISkin skin = EditorBuiltin.GUISkin;
GUIElementStyle style = skin.GetStyle(EditorStyles.Expand);
foldoutWidth = style.Width;
Rebuild();
}
开发者ID:BearishSun,项目名称:BansheeEngine,代码行数:23,代码来源:GUIFieldSelector.cs
示例19: Initialize
public override void Initialize()
{
base.Initialize();
this.AsteroidSO = new SceneObject(Ship_Game.ResourceManager.GetModel(string.Concat("Model/Asteroids/asteroid", this.whichRoid)).Meshes[0])
{
ObjectType = ObjectType.Static,
Visibility = ObjectVisibility.Rendered
};
this.WorldMatrix = ((((Matrix.Identity * Matrix.CreateScale(this.scale)) * Matrix.CreateRotationX(this.Xrotate)) * Matrix.CreateRotationY(this.Yrotate)) * Matrix.CreateRotationZ(this.Zrotate)) * Matrix.CreateTranslation(this.Position3D);
this.AsteroidSO.World = this.WorldMatrix;
base.Radius = this.AsteroidSO.ObjectBoundingSphere.Radius * this.scale * 0.65f;
int radius = (int)base.Radius / 5;
base.Position = new Vector2(this.Position3D.X, this.Position3D.Y);
this.Position3D.X = base.Position.X;
this.Position3D.Y = base.Position.Y;
this.Center = base.Position;
}
开发者ID:castroev,项目名称:StardriveBlackBox-verRadicalElements-,代码行数:17,代码来源:Asteroid.cs
示例20: UpdateImageScript
public UpdateImageScript(Control canvas, SceneObject obj = null)
: base(obj)
{
this.canvas = canvas;
if (this.openTextureDlg == null)
{
{
var openTextureDlg = new OpenFileDialog();
openTextureDlg.Filter = "Image File(*.BMP;*.JPG;*.GIF;*.PNG)|*.BMP;*.JPG;*.GIF;*.PNG";
this.openTextureDlg = openTextureDlg;
}
{
this.keyPress = this.glCanvas1_KeyPress;
this.canvas.KeyPress += this.keyPress;
}
}
}
开发者ID:bitzhuwei,项目名称:CSharpGL,代码行数:18,代码来源:UpdateImageScript.cs
注:本文中的SceneObject类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论