Skip to content

Commit

Permalink
Merge branch 'master' of aerys.in:minko
Browse files Browse the repository at this point in the history
  • Loading branch information
JMLX42 committed Oct 6, 2011
2 parents 06b52b9 + 9cd6b0b commit 307eb1d
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 38 deletions.
20 changes: 12 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@

/.project
/.settings
/bin
/.actionScriptProperties
/.flexLibProperties
/lib/minko.swf
/lib/minko_logo.swf
lib/minko.swf
lib/minko_logo.swf.actionScriptProperties
.actionScriptProperties
.flexProperties
.flexLibProperties
.project
.settings
bin/
bin-debug/
bin-release/
build/
html-template/
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Description

**3D for the Adobe Flash Platform.**

Minko is a tool that enables the creation of rich and interactive 3D web applications. Relying on the Adobe FlashTM Platform, Minko delivers high quality and interactive 3D graphics in any website.
Minko is a tool that enables the creation of rich and interactive 3D web applications. Relying on the Adobe Flash Platform, Minko delivers high quality and interactive 3D graphics in any website.

With Minko, you can build all kinds of applications such as:

Expand All @@ -33,7 +33,7 @@ The detailed list is available on [our website](http://aerys.in/minko/features).
Contribute
----------

`minko` is GPL-licensed. Make sure you tell us everything that's wrong!
`minko` is LGPL-licensed. Make sure you tell us everything that's wrong!

* [Source code](https://github.com/aerys/minko)
* [Issue tracker](https://github.com/aerys/minko/issues)
37 changes: 26 additions & 11 deletions src/aerys/minko/render/Viewport.as
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package aerys.minko.render
import aerys.minko.scene.visitor.RenderingVisitor;
import aerys.minko.scene.visitor.WorldDataVisitor;
import aerys.minko.type.Factory;

import flash.display.DisplayObject;
import flash.display.Graphics;
import flash.display.Shape;
Expand Down Expand Up @@ -56,6 +56,7 @@ package aerys.minko.render
private var _autoResize : Boolean = false;
private var _antiAliasing : int = 0;
private var _invalidRectangle : Boolean = true;
private var _upperLeft : Point = null;

private var _visitors : Vector.<ISceneVisitor> = null;

Expand Down Expand Up @@ -319,6 +320,8 @@ package aerys.minko.render
_stage3d.addEventListener(Event.CONTEXT3D_CREATE, resetStage3D);
_stage3d.requestContext3D(Context3DRenderMode.AUTO);
}

_stage3d.visible = true;

if (!_logoIsHidden)
showLogo();
Expand Down Expand Up @@ -354,6 +357,8 @@ package aerys.minko.render
{
if (event.target != this)
return ;

_stage3d.visible = false;

// _stage3d.removeEventListener(Event.CONTEXT3D_CREATE, resetStage3D);
// _stage3d.context3D.dispose();
Expand Down Expand Up @@ -391,7 +396,7 @@ package aerys.minko.render
{
if (_stage3d && _stage3d.context3D && _width && _height)
{
updateRectangle();
update();

_renderer = new _rendererClass(this, _stage3d.context3D);

Expand All @@ -404,17 +409,25 @@ package aerys.minko.render
}
}

private function updateRectangle() : void
private function update() : void
{
if (_stage3d)
{
var origin : Point = localToGlobal(ZERO2);
_upperLeft = localToGlobal(ZERO2);

if (_width > 2048)
_stageX = (_width - 2048) / 2.;
else
_stageX = _upperLeft.x;

if (_height > 2048)
_stageY = (_height - 2048) / 2.;
else
_stageY = _upperLeft.y;

var width : Number = Math.min(2048, _width);
var height : Number = Math.min(2048, _height);

_stageX = origin.x;
_stageY = origin.y;

_stage3d.x = _stageX;
_stage3d.y = _stageY;

Expand Down Expand Up @@ -478,7 +491,7 @@ package aerys.minko.render

private function stageResizeHandler(event : Event) : void
{
updateRectangle();
update();
}

private function stageEventHandler(event : Object) : void
Expand Down Expand Up @@ -548,10 +561,12 @@ package aerys.minko.render
{
var positionOnStage : Point = localToGlobal(ZERO2);

if (_invalidRectangle || _stageX != positionOnStage.x
|| _stageY != positionOnStage.y)
if (_invalidRectangle
|| _upperLeft.x != positionOnStage.x
|| _upperLeft.y != positionOnStage.y)
{
updateRectangle();
update();
_invalidRectangle = false;
}
}

Expand Down
11 changes: 0 additions & 11 deletions src/aerys/minko/render/shader/ActionScriptShaderPart.as
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,6 @@ package aerys.minko.render.shader
return new SValue(new Attribute(VertexComponent.TANGENT));
}


/**
* The weight of the current vertex for the wireframe effect.
* @return
*
*/
protected function get vertexWeight() : SValue
{
return new SValue(new Attribute(VertexComponent.WIRE));
}

/**
* The direction of the camera in local space.
* @return
Expand Down
10 changes: 5 additions & 5 deletions src/aerys/minko/type/parser/ParserOptions.as
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package aerys.minko.type.parser
private var _textureFilenameFunction : Function = null;
private var _textureFunction : Function = null;

// private var _sceneFunction : Function = null;
private var _meshFunction : Function = null;

private var _loadMeshes : Boolean = true;
private var _mergeMeshes : Boolean = false;
Expand All @@ -16,9 +16,9 @@ package aerys.minko.type.parser
public function get loadTextures() : Boolean { return _loadTextures; }
public function get textureFilenameFunction() : Function { return _textureFilenameFunction; }
public function get textureFunction() : Function { return _textureFunction; }
// public function get sceneFunction() : Function { return _sceneFunction; }

public function get loadMeshes() : Boolean { return _loadMeshes; }
public function get meshFunction() : Function { return _meshFunction; }
public function get mergeMeshes() : Boolean { return _mergeMeshes; }

public function get loadSkins() : Boolean { return _loadSkins; }
Expand All @@ -38,10 +38,10 @@ package aerys.minko.type.parser
_textureFunction = value;
}

/*public function set sceneFunction(value : Function) : void
public function set meshFunction(value : Function) : void
{
_sceneFunction = value;
}*/
_meshFunction = value;
}

public function set loadMeshes(value : Boolean) : void
{
Expand Down
1 change: 0 additions & 1 deletion src/aerys/minko/type/stream/format/VertexComponent.as
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ package aerys.minko.type.stream.format
public static const RGBA : VertexComponent = create(["r", "g", "b", "a"], VertexComponentType.FLOAT_4);
public static const NORMAL : VertexComponent = create(["nx", "ny", "nz"], VertexComponentType.FLOAT_3);
public static const ST : VertexComponent = create(["s", "t"], VertexComponentType.FLOAT_2);
public static const WIRE : VertexComponent = create(["w1", "w2", "w3"], VertexComponentType.FLOAT_3);

public static const TANGENT : VertexComponent = create(["tx", "ty", "tz"], VertexComponentType.FLOAT_3);

Expand Down

0 comments on commit 307eb1d

Please sign in to comment.