Quote: "Discussions List | Create New Discussion
Discussions for Fireball.DarkGDK "
This is empty.
Quote: "There are no work items."
<--Issue Tracker
Dark3DMesh.cs - CSharp... Not C++...
#region Fireball License
// Copyright (C) 2005 Sebastian Faltoni sebastian{at}dotnetfireball{dot}net
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#endregion
using System;
using System.Collections.Generic;
using System.Text;
namespace Fireball.DarkGDK
{
public class Dark3DMesh : DarkEntity
{
public Dark3DMesh()
{
//TODO:
}
protected override void OnDispose()
{
}
protected override void OnInitialize()
{
throw new Exception("The method or operation is not implemented.");
}
}
}
...still looking...
There's no code???
...Wait...
Dark3DObject.cs
#region Fireball License
// Copyright (C) 2005 Sebastian Faltoni sebastian{at}dotnetfireball{dot}net
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#endregion
using System;
using System.Collections.Generic;
using System.Text;
namespace Fireball.DarkGDK
{
/// <summary>
///
/// </summary>
public class Dark3DObject : DarkEntity
{
internal Dark3DObject()
{
}
public Dark3DObject(string filename)
{
DarkSystem.Basic3D.LoadObject(filename, this.ID);
}
protected override void OnInitialize()
{
this.SetID(Dark3DObjectManager.Istance.GetFreeID());
Dark3DObjectManager.Istance.Set(this.ID);
}
/// <summary>
///
/// </summary>
/// <param name="filename"></param>
/// <param name="startFrame"></param>
public void AppendObject(string filename, int startFrame)
{
DarkSystem.Basic3D.AppendObject(filename, this.ID, startFrame);
}
/// <summary>
///
/// </summary>
/// <returns></returns>
public object Clone()
{
Dark3DObject obj = new Dark3DObject();
int newId = Dark3DObjectManager.Istance.GetFreeID();
DarkSystem.Basic3D.CloneObject(newId, this.ID);
obj.SetID(newId);
return obj;
}
/// <summary>
///
/// </summary>
public bool IsVisible
{
get
{
int i = DarkSystem.Basic3D.ObjectVisible(this.ID);
return i == 1 ? true : false;
}
}
public void MakeTrasparent()
{
DarkSystem.Basic3D.GhostObjectOn(this.ID);
}
public void MakeNegativeTrasparent()
{
DarkSystem.Basic3D.GhostObjectOnB(this.ID,1);
}
public void RemoveTrasparent()
{
DarkSystem.Basic3D.GhostObjectOff(this.ID);
}
public void Hide()
{
DarkSystem.Basic3D.HideObject(this.ID);
}
public void Show()
{
DarkSystem.Basic3D.ShowObject(this.ID);
}
public Dark3DPoint Location
{
get
{
return new Dark3DPoint(DarkSystem.Basic3D.ObjectPositionX(this.ID),
DarkSystem.Basic3D.ObjectPositionY(this.ID),
DarkSystem.Basic3D.ObjectPositionZ(this.ID));
}
set
{
DarkSystem.Basic3D.PositionObject(this.ID, value.X, value.Y, value.Z);
}
}
public void PointDirection(Dark3DPoint direction)
{
PointDirection(direction.X, direction.Y, direction.Z);
}
public void PointDirection(float x, float y, float z)
{
DarkSystem.Basic3D.PointObject(this.ID, x, y, z);
}
public void Rotate(float x, float y, float z)
{
DarkSystem.Basic3D.RotateObject(this.ID, x, y, z);
}
public void MoveObject(float step)
{
DarkSystem.Basic3D.MoveObject(this.ID, step);
}
public void MoveDown(float step)
{
DarkSystem.Basic3D.MoveObjectDown(this.ID, step);
}
public void MoveLeft(float step)
{
DarkSystem.Basic3D.MoveObjectLeft(this.ID, step);
}
public void MoveRight(float step)
{
DarkSystem.Basic3D.MoveObjectRight(this.ID, step);
}
public void MoveUp(float step)
{
DarkSystem.Basic3D.MoveObjectUp(this.ID, step);
}
public void XRotate(float step)
{
DarkSystem.Basic3D.XRotateObject(this.ID, step);
}
public void YRotate(float step)
{
DarkSystem.Basic3D.YRotateObject(this.ID, step);
}
public void ZRotate(float step)
{
DarkSystem.Basic3D.ZRotateObject(this.ID, step);
}
public void TurnLeft(float value)
{
DarkSystem.Basic3D.TurnObjectLeft(this.ID, value);
}
public void TurnRight(float value)
{
DarkSystem.Basic3D.TurnObjectRight(this.ID, value);
}
public void PitchUp(float value)
{
DarkSystem.Basic3D.PitchObjectUp(this.ID, value);
}
public void PitchDown(float value)
{
DarkSystem.Basic3D.PitchObjectDown(this.ID, value);
}
public void RollLeft(float value)
{
DarkSystem.Basic3D.RollObjectLeft(this.ID, value);
}
public void RollRight(float value)
{
DarkSystem.Basic3D.RollObjectRight(this.ID, value);
}
public void PlayAnimation()
{
DarkSystem.Basic3D.PlayObject(this.ID);
}
public void PlayAnimation(int startFrame)
{
DarkSystem.Basic3D.PlayObjectB(this.ID, startFrame);
}
public void PlayAnimation(int startFrame,int endFrame)
{
DarkSystem.Basic3D.PlayObjectC(this.ID, startFrame, endFrame);
}
public void LoopAnimation()
{
DarkSystem.Basic3D.LoopObject(this.ID);
}
public void LoopAnimation(int startFrame)
{
DarkSystem.Basic3D.LoopObjectB(this.ID, startFrame);
}
public void LoopAnimation(int startFrame,int endFrame)
{
DarkSystem.Basic3D.LoopObjectC(this.ID, startFrame, endFrame);
}
public void StopAnimation()
{
DarkSystem.Basic3D.StopObject(this.ID);
}
public void SetAnimationFrame(int frame)
{
DarkSystem.Basic3D.SetObjectFrame(this.ID,frame);
}
public void SetAnimationFrame(float frame)
{
DarkSystem.Basic3D.SetObjectFrameB(this.ID, frame);
}
public void SetAnimationFrame(float frame,bool recalculateBounds)
{
DarkSystem.Basic3D.SetObjectFrameC(this.ID, frame, (recalculateBounds ? 1 : 0));
}
public void SetAnimationSpeed(int speed)
{
DarkSystem.Basic3D.SetObjectSpeed(this.ID, speed);
}
private int? _AnimationInterpolation = null;
public int? AnimationInterpolation
{
get
{
return _AnimationInterpolation;
}
set
{
_AnimationInterpolation = value;
if (_AnimationInterpolation == null)
DarkSystem.Basic3D.SetObjectInterpolation(this.ID, 100);
else
DarkSystem.Basic3D.SetObjectInterpolation(this.ID,
_AnimationInterpolation.Value);
}
}
#region Creation Methods
public static Dark3DObject Create(Dark3DMesh mesh, DarkImage image)
{
int id = Dark3DObjectManager.Istance.GetFreeID();
DarkSystem.Basic3D.MakeObject(id, mesh.ID, image.ID);
Dark3DObject ob = new Dark3DObject();
ob.SetID(id);
return ob;
}
public static Dark3DObject CreateBox(Dark3DSize size)
{
int id = Dark3DObjectManager.Istance.GetFreeID();
DarkSystem.Basic3D.MakeObjectBox(id, size.Width, size.Height, size.Depth);
Dark3DObject ob = new Dark3DObject();
ob.SetID(id);
return ob;
}
public static Dark3DObject CreateCone(float size)
{
int id = Dark3DObjectManager.Istance.GetFreeID();
DarkSystem.Basic3D.MakeObjectCone(id, size);
Dark3DObject ob = new Dark3DObject();
ob.SetID(id);
return ob;
}
public static Dark3DObject CreateCube(float size)
{
int id = Dark3DObjectManager.Istance.GetFreeID();
DarkSystem.Basic3D.MakeObjectCube(id, size);
Dark3DObject ob = new Dark3DObject();
ob.SetID(id);
return ob;
}
public static Dark3DObject CreateCylinder(float size)
{
int id = Dark3DObjectManager.Istance.GetFreeID();
DarkSystem.Basic3D.MakeObjectCylinder(id, size);
Dark3DObject ob = new Dark3DObject();
ob.SetID(id);
return ob;
}
public static Dark3DObject CreatePlane(float width, float height)
{
int id = Dark3DObjectManager.Istance.GetFreeID();
DarkSystem.Basic3D.MakeObjectPlane(id, width, height);
Dark3DObject ob = new Dark3DObject();
ob.SetID(id);
return ob;
}
public static Dark3DObject CreateSphere(float radius)
{
int id = Dark3DObjectManager.Istance.GetFreeID();
DarkSystem.Basic3D.MakeObjectSphereB(id, radius);
Dark3DObject ob = new Dark3DObject();
ob.SetID(id);
return ob;
}
public static Dark3DObject CreateSphere(float radius,int rings,int segments)
{
int id = Dark3DObjectManager.Istance.GetFreeID();
DarkSystem.Basic3D.MakeObjectSphere(id, radius, rings, segments);
Dark3DObject ob = new Dark3DObject();
ob.SetID(id);
return ob;
}
public static Dark3DObject CreateTriangle(Dark3DPoint point1, Dark3DPoint point2, Dark3DPoint point3)
{
int id = Dark3DObjectManager.Istance.GetFreeID();
DarkSystem.Basic3D.MakeObjectTriangle(id, point1.X, point1.Y, point1.Z,
point2.X, point2.Y, point2.Z,
point3.X, point3.Y, point3.Z);
Dark3DObject ob = new Dark3DObject();
ob.SetID(id);
return ob;
}
public static Dark3DObject CreateFromLimb(Dark3DObject ownerObject, Dark3DMesh mesh)
{
int id = Dark3DObjectManager.Istance.GetFreeID();
DarkSystem.Basic3D.MakeObjectFromLimb(id, ownerObject.ID, mesh.ID);
Dark3DObject ob = new Dark3DObject();
ob.SetID(id);
return ob;
}
#endregion
#region Appearance Commands
private bool _Ghost = false;
public bool Ghost
{
get
{
return _Ghost;
}
set
{
_Ghost = value;
if (_Ghost)
DarkSystem.Basic3D.GhostObjectOn(this.ID);
else
DarkSystem.Basic3D.GhostObjectOff(this.ID);
}
}
public void SetColor(DarkColor color)
{
uint cl = color.ToNativeColor();
DarkSystem.Basic3D.ColorObject(this.ID, cl);
}
public void Fade(float fadePercentage)
{
DarkSystem.Basic3D.FadeObject(this.ID, fadePercentage);
}
public void Fade(int fadePercentage)
{
DarkSystem.Basic3D.FadeObjectB(this.ID, fadePercentage);
}
private bool? _Locked = null;
public bool? Locked
{
get
{
return _Locked;
}
set
{
_Locked = value;
if (_Locked == null || _Locked.Value == false)
DarkSystem.Basic3D.LockObjectOn(this.ID);
else
DarkSystem.Basic3D.LockObjectOff(this.ID);
}
}
#endregion
bool disposed = false;
protected override void OnDispose()
{
if (!disposed)
{
Dark3DObjectManager.Istance.UnSet(this.ID);
DarkSystem.Basic3D.DeleteObject(this.ID);
disposed = true;
}
}
}
}
Found Some! This Guy has very clean code so far. It looks like he's just getting the ball rolling... Except for the 2005 copyright date.
8 Downloads
selected period change previous period description
Downloads: 8
0.14 downloads / visit
0.26 downloads / day +4
+0.07
+0.13 4
0.06 downloads / visit
0.13 downloads / day Download counts are for all publicly available releases, source code changesets, and wiki attachments. Mouse over a data point to see download traffic for that specific date.
Quote: "This Project has no releases."
He must be pickier than me
My current release is JGC 1.1, and there is a 32k (tiny) patch - 3 source files - that fix centered bitmap fonts and right justified ones, as well as ofsetting the bitmap fonts on GUI buttons. (Forgot to add font offset X and Y :-| ... LOL)?
I was kinda excited when I saw this post. I think TGC (And Apex) are still developing the .Net release for DarkGDK.Net and I think it might have a oop approach.. but I don't know for certain.
Well.. I wish Sebastian the best... He obviously has a clean style about him. Maybe we do know him... maybe not.. but He'd be a welcome addition to the crew, that's for sure!
P.S. If you don't have my latest Version - you should snag it because its the tightest yet - seriously - it's up to 150+ configuration parameters, self "clean up" of DarkGDK entities.. (So you literally COULD write sloppy code if you were so desiring... (BAD IDEA but..) the lib cleans all that up if you at least clean up your non GDK entities and classes .. Its faster now, and alot of "missing" functions were added to many GDK entities and all the demos have been "aligned" with the new version - so I hope you give it a facelift by DL'ing the latest unitech... I think you'll like it better than previous versions. It's starting to mature.
http://code.google.com/p/darkgdkoop/