本文整理汇总了C#中MetaModel类的典型用法代码示例。如果您正苦于以下问题:C# MetaModel类的具体用法?C# MetaModel怎么用?C# MetaModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MetaModel类属于命名空间,在下文中一共展示了MetaModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
MetaModel model = new MetaModel();
model.RegisterContext(() => new YAWAMT.DataClassesDataContext(new Config().ConnectionString), new ContextConfiguration() { ScaffoldAllTables = false });
routes.Add(new DynamicDataRoute("Data/{table}/ListDetails.aspx")
{
Action = PageAction.List,
ViewName = "ListDetails",
Model = model
});
routes.Add(new DynamicDataRoute("Data/{table}/ListDetails.aspx")
{
Action = PageAction.Details,
ViewName = "ListDetails",
Model = model
});
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
//routes.Add(new DynamicDataRoute("Data/{table}/{action}.aspx")
//{
// Constraints = new RouteValueDictionary(new { action = "List|Details|Edit|Insert" }),
// Model = model
//});
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = "" } // Parameter defaults
);
}
示例2: Water
public Water(Map.Map map)
{
MainGraphic = new MetaModel
{
AlphaRef = 0,
HasAlpha = true,
IsWater = true,
Texture = new TextureFromFile("Models/Props/Sky1.png"),
SpecularTexture = new TextureFromFile("Models/Props/WaterSpecular1.png"),
ReceivesAmbientLight = Priority.Never,
ReceivesDiffuseLight = Priority.Never,
ReceivesSpecular = Priority.Never,
SpecularExponent = 3,
TextureAddress = SlimDX.Direct3D9.TextureAddress.Wrap,
XMesh = new MeshConcretize
{
MeshDescription = new Graphics.Software.Meshes.IndexedPlane
{
Position = Common.Math.ToVector3(map.Settings.Position) +
Vector3.UnitZ * map.Settings.WaterHeight,
Size = new Vector2(map.Ground.Size.Width, map.Ground.Size.Height),
UVMin = Vector2.Zero,
UVMax = new Vector2(1, 1),
Facings = Facings.Frontside
},
Layout = global::Graphics.Software.Vertex.PositionNormalTexcoord.Instance
},
};
//VisibilityLocalBounding = new BoundingBox(new Vector3(-1000, -1000, -1000), new Vector3(1000, 1000, 1000))
VisibilityLocalBounding = new Common.Bounding.NonfittableBounding(new BoundingBox(new Vector3(-1000, -1000, -1000), new Vector3(1000, 1000, 1000)), false, true);
}
示例3: BoxBlocker
public BoxBlocker()
{
Vector3 minPoint = new Vector3(-1, -1, 0);
Vector3 maxPoint = new Vector3(1, 1, 2);
MainGraphic = new MetaModel
{
XMesh = new MeshConcretize
{
MeshDescription =
new global::Graphics.Software.Meshes.BoxMesh(minPoint, maxPoint, Facings.Frontside, false),
Layout = global::Graphics.Software.Vertex.PositionNormalTexcoord.Instance
},
HasAlpha = true,
Texture = new TextureFromFile("Models/Effects/Blue1.png"),
ReceivesAmbientLight = Priority.Never,
ReceivesDiffuseLight = Priority.Never,
};
PickingLocalBounding = VisibilityLocalBounding = new MetaBoundingBox
{
Mesh = ((MetaModel)MainGraphic).XMesh,
Transformation = ((MetaModel)MainGraphic).World
};
//PhysicsLocalBounding = CreatePhysicsMeshBounding((MetaModel)MainGraphic);
PhysicsLocalBounding = new Common.Bounding.Box { LocalBoundingBox = new BoundingBox(minPoint, maxPoint) };
}
示例4: Point
public Point()
{
MainGraphic = new MetaModel
{
XMesh = new MeshConcretize
{
MeshDescription =
new global::Graphics.Software.Meshes.BoxMesh(new Vector3(-0.1f, -0.1f, 0), new Vector3(0.1f, 0.1f, 0.2f), Facings.Frontside, false),
Layout = global::Graphics.Software.Vertex.PositionNormalTexcoord.Instance
},
Texture = new TextureConcretizer
{
TextureDescription = new global::Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.Blue)
},
ReceivesAmbientLight = Priority.Never,
ReceivesDiffuseLight = Priority.Never,
};
PickingLocalBounding = VisibilityLocalBounding = new MetaBoundingBox
{
Mesh = ((MetaModel)MainGraphic).XMesh,
Transformation = ((MetaModel)MainGraphic).World
};
VisibleInGame = false;
Dynamic = false;
}
示例5: Insert
public void Insert(Content.Model9 model, Entity e, MetaModel metaResource, string metaName)
{
RenderSplatMesh m;
if (!SplatMeshes.TryGetValue(model.XMesh, out m))
SplatMeshes[model.XMesh] = m = new RenderSplatMesh();
m.Insert(model, e, metaResource, metaName);
}
示例6: PropertiesOptimization
/// <summary>
/// Constructor.
/// </summary>
/// <param name="metaModel"></param>
/// <param name="modelContext"></param>
public PropertiesOptimization(MetaModel metaModel, LibraryModelContext modelContext)
: base(metaModel, modelContext)
{
InvolvedProperties = new List<DomainProperty>();
this.CreateIntermediate = false;
this.IsInheritance = false;
}
示例7: Projectile
public Projectile()
{
MainGraphic = new MetaModel
{
XMesh = new MeshConcretize
{
MeshDescription = new Graphics.Software.Meshes.IndexedPlane
{
Position = Vector3.Zero,
Size = new Vector2(1, 1),
UVMin = new Vector2(0, 0),
UVMax = new Vector2(1, 1),
Facings = global::Graphics.Facings.Frontside
},
Layout = global::Graphics.Software.Vertex.PositionNormalTexcoord.Instance,
},
World = Matrix.Translation(-0.5f, -1, 0) * Matrix.Scaling(0.08f, 1.0f, 1)
//* Matrix.RotationZ((float)Math.PI/2f)
* Matrix.RotationX(-(float)Math.PI/2f)
,
Texture = new TextureFromFile("Models/Effects/Trajectory1.png"),
HasAlpha = true,
Opacity = 0.5f
};
VisibilityLocalBounding = new Common.Bounding.NonfittableBounding(Vector3.Zero, false, true);
PickingLocalBounding = new MetaBoundingBox
{
Mesh = ((MetaModel)MainGraphic).XMesh,
Transformation = ((MetaModel)MainGraphic).World
};
PhysicsLocalBounding = Vector3.Zero;
TimeToLive = 0.4f;
Updateable = true;
}
示例8: GroundSplatterDecal
public GroundSplatterDecal()
{
var size = new Vector2(5 * ((float)Game.Random.NextDouble() * 0.2f + 0.4f), 5 * ((float)Game.Random.NextDouble() * 0.2f + 0.4f));
var gridPosition = Common.Math.ToVector3(-size / 2f);
MainGraphic = new MetaModel
{
AlphaRef = 0,
HasAlpha = true,
Texture = new TextureFromFile("Models/Effects/Bloodsplatter3.png"),
SpecularTexture = new TextureFromFile("Models/Effects/BloodsplatterSpecular3.png"),
DontSort = true,
#if USE_OLD_GROUND_DECALS
World = Matrix.Translation(0, 0, 0.01f),
#else
World = Matrix.Scaling(size.X, size.Y, 1) * Matrix.Translation(gridPosition.X, gridPosition.Y, 0.01f),
#endif
TextureAddress = SlimDX.Direct3D9.TextureAddress.Clamp,
ReceivesSpecular = Priority.Medium,
ReceivesShadows = Priority.High,
SpecularExponent = 10,
};
RotateUV = true;
Orientation = (float)Game.Random.NextDouble() *
(float)Math.PI * 2.0f;
SnapPositionToHeightmap = DecalSnapping.SnapAndUVAntiSnap;
#if USE_OLD_GROUND_DECALS
SnapSizeToHeightmap = true;
Size = size;
GridPosition = gridPosition;
#else
SnapSizeToHeightmap = DecalSnapping.Snap;
#endif
Dynamic = false;
}
示例9: Rotten
public Rotten()
{
HitPoints = MaxHitPoints = 40;
RunSpeed = MaxRunSpeed = 2.5f;
HeadOverBarHeight = 1.25f;
SilverYield = 1;
SplatRequiredDamagePerc = 0;
RageYield = 6f;
MainGraphic = new MetaModel
{
SkinnedMesh = new SkinnedMeshFromFile("Models/Units/Rotten1.x"),
Texture = new TextureFromFile("Models/Units/Rotten1.png"),
SpecularTexture = new TextureFromFile("Models/Units/RottenSpecular1.png"),
World = SkinnedMesh.InitSkinnedMeshFromMaya * Matrix.Scaling(0.1f, 0.1f, 0.1f),
AlphaRef = 254,
CastShadows = global::Graphics.Content.Priority.High,
ReceivesShadows = global::Graphics.Content.Priority.High,
ReceivesSpecular = global::Graphics.Content.Priority.High,
SpecularExponent = 6,
};
VisibilityLocalBounding = CreateBoundingBoxFromModel((MetaModel)MainGraphic);
PickingLocalBounding = CreateBoundingMeshFromModel((MetaModel)MainGraphic);
AddAbility(new RottenThrust());
}
示例10: Commander
public Commander()
{
HitPoints = MaxHitPoints = 240;
SplatRequiredDamagePerc = 160 / (float)MaxHitPoints;
SilverYield = 5;
MainGraphic = new MetaModel
{
SkinnedMesh = new SkinnedMeshFromFile("Models/Units/Zombie1.x"),
Texture = new TextureFromFile("Models/Units/Commander1.png"),
SpecularTexture = new TextureFromFile("Models/Units/CommanderSpecular1.png"),
World = SkinnedMesh.InitSkinnedMeshFromMaya * Matrix.Scaling(0.12f, 0.12f, 0.12f),
AlphaRef = 254,
CastShadows = global::Graphics.Content.Priority.High,
ReceivesShadows = global::Graphics.Content.Priority.High,
ReceivesSpecular = Priority.High,
SpecularExponent = 6,
};
VisibilityLocalBounding = CreateBoundingBoxFromModel((MetaModel)MainGraphic);
PickingLocalBounding = CreateBoundingMeshFromModel((MetaModel)MainGraphic);
//AddAbility(new FrenzyScream());
AddAbility(new GruntThrust());
AddAbility(new FrenzyScreamAOE());
//AddBuff(new FrenzyScreamAOE(), this, this);
}
示例11: RegisterModelRoutes
public static void RegisterModelRoutes(RouteCollection routes, MetaModel model, string prefix, bool useSeperatePages) {
if (useSeperatePages) {
// The following statement supports separate-page mode, where the List, Detail, Insert, and
// Update tasks are performed by using separate pages. To enable this mode, uncomment the following
// route definition, and comment out the route definitions in the combined-page mode section that follows.
routes.Add(new DynamicDataRoute(prefix + "/{table}/{action}.aspx") {
Constraints = new RouteValueDictionary(new { action = "List|Details|Edit|Insert" }),
Model = model
});
} else {
// The following statements support combined-page mode, where the List, Detail, Insert, and
// Update tasks are performed by using the same page. To enable this mode, uncomment the
// following routes and comment out the route definition in the separate-page mode section above.
routes.Add(new DynamicDataRoute("{table}/ListDetails.aspx") {
Action = PageAction.List,
ViewName = "ListDetails",
Model = model
});
routes.Add(new DynamicDataRoute("{table}/ListDetails.aspx") {
Action = PageAction.Details,
ViewName = "ListDetails",
Model = model
});
}
}
示例12: Item
public Item(MetaModel metaModel, MetaItem metaItem, Guid itemId, string itemName)
: base(metaModel, itemId)
{
this.metaItem = metaItem;
this.itemId = itemId;
this.itemName = itemName;
}
示例13: CreateCategorizedVMWithoutImported
public static CategorizedSelectionViewModel CreateCategorizedVMWithoutImported(MetaModel model, ViewModelStore store, SelectionHelperTarget target)
{
// categories for main meta model as well as imported ones
List<CategorizedAdvSelectableViewModel> modelCategoryVMs = new List<CategorizedAdvSelectableViewModel>();
CategorizedAdvSelectableViewModel modelCategoryVM = CreateCategorizedAdvSelectableVM(model, model.Name, store, target);
modelCategoryVMs.Add(modelCategoryVM);
return new CategorizedSelectionViewModel(store, modelCategoryVMs);
}
示例14: CreateCategorizedVM
public static CategorizedSelectionViewModel CreateCategorizedVM(MetaModel model, ViewModelStore store, SelectionHelperTarget target)
{
// categories for main meta model as well as imported ones
List<MetaModel> handledMetaModels = new List<MetaModel>();
List<CategorizedAdvSelectableViewModel> modelCategoryVMs = new List<CategorizedAdvSelectableViewModel>();
CreateCategorizedVM(model, store, target, handledMetaModels, modelCategoryVMs);
return new CategorizedSelectionViewModel(store, modelCategoryVMs);
}
示例15: Insert
public void Insert(Content.Model9 model, Entity e, MetaModel metaResource, string metaName)
{
if (model.Texture != null)
{
RenderLeaf r;
if (!Textures.TryGetValue(model.Texture, out r))
Textures[model.Texture] = r = new RenderLeaf();
r.Insert(model, e, metaResource, metaName);
}
}