本文整理汇总了C#中IRenderable类的典型用法代码示例。如果您正苦于以下问题:C# IRenderable类的具体用法?C# IRenderable怎么用?C# IRenderable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IRenderable类属于命名空间,在下文中一共展示了IRenderable类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetDisplayName
public static string GetDisplayName(IRenderable obj)
{
string name = obj.Name;
string[] parts = name.Split('/');
return parts[parts.Length-1];
}
开发者ID:anand-ajmera,项目名称:cornell-urban-challenge,代码行数:7,代码来源:DisplayObjectService.cs
示例2: setUp
public void setUp( Vector2 position, int width, int height, ILogic brain = null, BodyBase body = null, IRenderable renderer = null, IMovable mover = null )
{
// Start setUp.
if (!_setUp)
{ // Start not setup if.
_position = position;
_width = width;
_height = height;
_setUp = true;
if (brain != null)
_brain = brain;
if (body != null)
_body = body;
if (renderer != null)
_renderer = renderer;
if ( mover != null)
_mover = mover;
} // End not setup if.
}
开发者ID:ericamccowan,项目名称:ILS,代码行数:27,代码来源:BaseGameObject.cs
示例3: EnqueueForRendering
public void EnqueueForRendering(IRenderable obj)
{
char[,] objImage = obj.ImageProfile;
int imageRows = objImage.GetLength(0);
int imageCols = objImage.GetLength(1);
Point objTopLeft = obj.Bounds.TopLeft;
int lastRow = Math.Min(objTopLeft.Y + imageRows, this.consoleHeight);
int lastCol = Math.Min(objTopLeft.X + imageCols, this.consoleWidth);
for (int row = objTopLeft.Y; row < lastRow; row++)
{
for (int col = objTopLeft.X; col < lastCol; col++)
{
if (row >= 0 && row < this.consoleHeight &&
col >= 0 && col < this.consoleWidth)
{
this.consoleMatrix[row, col] =
objImage[row - objTopLeft.Y, col - objTopLeft.X];
}
}
}
}
开发者ID:EBojilova,项目名称:CSharp-OOP-June-2015,代码行数:25,代码来源:ConsoleRenderer.cs
示例4: IconButton
public IconButton(IGameWindow window, Camera<OrthographicProjection> camera, Vector2 position, IRenderable renderable, Key? hotkey = null)
: base(window, camera, position)
{
Renderable = renderable;
IsSelected = false;
Hotkey = hotkey;
}
开发者ID:treytomes,项目名称:ASCIIWorld2,代码行数:7,代码来源:IconButton.cs
示例5: DrawObject
public void DrawObject(IRenderable obj)
{
Camera cam = (Camera) this.Game.Services.GetService(typeof(ICameraService));
Model m = obj.Model3D;
Matrix[] transforms = new Matrix[m.Bones.Count];
m.CopyAbsoluteBoneTransformsTo(transforms);
Matrix projection = cam.Projection;
Matrix view = cam.View;
foreach (ModelMesh mesh in m.Meshes)
{
foreach (BasicEffect effect in mesh.Effects)
{
effect.EnableDefaultLighting();
effect.View = view;
effect.Projection = projection;
effect.World = transforms[mesh.ParentBone.Index] * Matrix.CreateFromQuaternion(obj.Orientation) * Matrix.CreateTranslation(obj.Position + obj.PositionOffset);
}
mesh.Draw();
}
}
开发者ID:peterciullo,项目名称:mammoth,代码行数:26,代码来源:Renderer.cs
示例6: GeometryNode
/// <summary>
/// Initializes a new instance of GeometryNode.
/// </summary>
public GeometryNode(Renderer renderer, SceneGraph sceneGraph, Matrix localTransform,
IRenderable renderObject)
: base(renderer, sceneGraph)
{
this.localTransform = localTransform;
this.renderObject = renderObject;
}
开发者ID:zpconn,项目名称:Dynamic2DLightning,代码行数:10,代码来源:GeometryNode.cs
示例7: AddRenderable
/// <summary>
/// Add a IRenderable to this group
/// </summary>
/// <param name="renderable">IRenderable instance</param>
internal void AddRenderable(IRenderable renderable)
{
Material material = renderable.Material;
if (!material.IsTransparent) _solids.Add(renderable);
else _transparents.Add(renderable);
}
开发者ID:Julien-Pires,项目名称:Pulsar,代码行数:11,代码来源:RenderQueueGroup.cs
示例8: ReplaceRenderable
public ReplaceRenderable(string NodeName, IRenderable NewRenderable)
{
this.NodeName = NodeName;
this.NewRenderable = NewRenderable;
OldRenderable = OutsideSimulatorApp.GetInstance().SceneRootNode.GetDescendant(NodeName).Renderable;
_isPerformed = false;
}
开发者ID:sessamekesh,项目名称:OutsideSimulator,代码行数:7,代码来源:ReplaceRenderable.cs
示例9: Add
public void Add(IRenderable renderable)
{
lock (mRenderables)
{
mRenderables.Add(renderable);
}
}
开发者ID:jiailiuyan,项目名称:Gum,代码行数:7,代码来源:Layer.cs
示例10: Add
public void Add(IRenderable renderable)
{
if(Children.Contains(renderable))
return;
Children.Add(renderable);
if(renderable is Mesh3d)
{
Mesh3d mesh = renderable as Mesh3d;
if(mesh.GetCollisionShape() != null || renderable is IPhysical)
{
lock(PhysicalWorld)
{
CollisionObjects.Add(renderable, mesh.CreateRigidBody());
mesh.PhysicalBody.SetSleepingThresholds(0, 0);
mesh.PhysicalBody.ContactProcessingThreshold = 0;
mesh.PhysicalBody.CcdMotionThreshold = 0;
PhysicalWorld.AddRigidBody(mesh.PhysicalBody);
}
}
}
else if(renderable is IPhysical)
{
IPhysical physicalObject = renderable as IPhysical;
lock(PhysicalWorld)
{
PhysicalWorld.AddRigidBody(physicalObject.GetRigidBody());
physicalObject.GetRigidBody().SetSleepingThresholds(0, 0);
physicalObject.GetRigidBody().ContactProcessingThreshold = 0;
physicalObject.GetRigidBody().CcdMotionThreshold = 0;
}
}
}
开发者ID:yanko,项目名称:vengine,代码行数:32,代码来源:World.cs
示例11: RenderableNode
public RenderableNode(IRenderable renderableObject)
: base(Text.GetCapitalLetters(typeof(RenderableNode).GetType().Name) + '_' + ++count, SceneNodeType.Renderable)
{
IsLeaf = true;
this.RenderableObject = renderableObject;
renderableObject.ParentNode = this;
}
开发者ID:yong-ja,项目名称:starodyssey,代码行数:7,代码来源:RenderableNode.cs
示例12: CreateObject
/// <summary>
/// Create the action to create an object
/// </summary>
/// <param name="parent">The parent scene node to which to attach the object</param>
/// <param name="renderable">The renderable to provide to the node</param>
public CreateObject(IRenderable renderable, Matrix transform)
{
IsPerformed = false;
ParentNode = OutsideSimulatorApp.GetInstance().SceneRootNode;
ChildName = (ParentNode.GetHashCode() + DateTime.Now.GetHashCode()).ToString();
Renderable = renderable;
Transform = transform;
}
开发者ID:sessamekesh,项目名称:OutsideSimulator,代码行数:13,代码来源:CreateObject.cs
示例13: RenderPacket
/// <summary>
/// Initializes a new instance of RenderPacket.
/// </summary>
public RenderPacket( IRenderable renderObject, string materialName, Matrix localTransform,
List<object> extraData)
{
RenderObject = renderObject;
MaterialName = materialName;
LocalTransform = localTransform;
ExtraData = extraData;
}
开发者ID:zpconn,项目名称:Gas,代码行数:11,代码来源:RenderPacket.cs
示例14: Render
public void Render(IRenderable obj)
{
var image = this.AssetLoader.GetImage(obj.Type);
Canvas.SetLeft(image, obj.X);
Canvas.SetTop(image, obj.Y);
this.Canvas.Children.Add(image);
}
开发者ID:peterkirilov,项目名称:SoftUni-1,代码行数:8,代码来源:Renderer.cs
示例15: ApplyInstanceParameters
public void ApplyInstanceParameters(IRenderable rObject)
{
foreach (InstanceParameter p in instanceParameters.Values)
{
//VerboseEvent.InstanceParameterSetting.Log(rObject.Name, p.Type.ToString());
p.Apply(rObject);
}
}
开发者ID:yong-ja,项目名称:starodyssey,代码行数:8,代码来源:EffectDescription.cs
示例16: Render
public static string Render(IRenderable renderable)
{
var memoryStream = new MemoryStream();
var streamWriter = new StreamWriter(memoryStream, Encoding.UTF8);
streamWriter.AutoFlush = true;
renderable.Render(streamWriter);
memoryStream.Seek(0, SeekOrigin.Begin);
return new StreamReader(memoryStream, Encoding.UTF8).ReadToEnd();
}
开发者ID:fmedio,项目名称:Peach,代码行数:9,代码来源:TagTest.cs
示例17: GBSystem
public GBSystem(IRenderable renderWindow, IInputHandler iInputHandler, ITimekeeper timeKeeper)
{
screen = renderWindow;
state = GBSystemState.Stopped;
isFocused = true;
inputHandler = iInputHandler;
frameTimer = timeKeeper;
frameLimitIndex = 1;
}
开发者ID:Silenthal,项目名称:gbemu,代码行数:9,代码来源:GBSystem.cs
示例18: Create
public static IRenderable Create(IRenderable parentElement, string ID)
{
var returnObj = new Renderable_IRenderable
{
parentElement = parentElement,
ID = ID,
};
return returnObj;
}
开发者ID:bahrus,项目名称:teaspoon,代码行数:9,代码来源:Interface_ElX_c.cs
示例19: SetDirection
internal void SetDirection(IRenderable renderer, vec3 direction)
{
direction.y = 0;
direction = direction.normalize();
float cosRadian = direction.dot(new vec3(1, 0, 0));// (1, 0, 0) is teapot's default direction.
float radian = (float)Math.Acos(cosRadian);
if (direction.z > 0) { radian = -radian; }
renderer.RotationAngleDegree = (float)(radian * 180.0 / Math.PI);
}
开发者ID:bitzhuwei,项目名称:CSharpGL,代码行数:9,代码来源:Form12Billboard.cs
示例20: update
public void update( IColidable body, IRenderable renderer )
{
// Start Update.
if( body.hasCollided && !( (AnimationComponent) renderer ).isRunning )
{
}
}
开发者ID:ericamccowan,项目名称:ILS,代码行数:9,代码来源:DoorLogic.cs
注:本文中的IRenderable类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论