www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 8dff16887ee344ad97fda09f763990a6933caaae
parent 30251f62c0ceb30550de7e0e085de41db6593ced
Author: Yoann <yoann.b87@voila.fr>
Date:   Mon,  9 Jan 2012 19:46:17 +0100

Transformation des block en six murs indépendants lors de du split.

Diffstat:
Mrules/batiment/batimentquadblock.cpp | 19++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/rules/batiment/batimentquadblock.cpp b/rules/batiment/batimentquadblock.cpp @@ -15,9 +15,22 @@ bool BatimentQuadBlock::split() { Quad mw = c; Quad mn = c; - me[NW] = me[NE] + ((me[NW] - me[NW]) / me.length(N))*150; - //TODO les autres côtés. - return false; + me[NW] = me[NE] + ((me[NW] - me[NE]) / me.length(N))*28; + me[SW] = me[SE] + ((me[SW] - me[SE]) / me.length(S))*28; + mw[NE] = mw[NW] + ((mw[NE] - mw[NW]) / mw.length(N))*28; + mw[SE] = mw[SW] + ((mw[SE] - mw[SW]) / mw.length(S))*28; + mn.inset(W,-28); mn.inset(E,-28); + mn[SW] = mn[NW] + ((mn[SW] - mn[NW]) / mn.length(W))*28; + mn[SE] = mn[NE] + ((mn[SE] - mn[NE]) / mn.length(E))*28; + ms.inset(W,-28); ms.inset(E,-28); + ms[NW] = ms[SW] + ((ms[NW] - ms[SW]) / ms.length(W))*28; + ms[NE] = ms[SE] + ((ms[NE] - ms[SE]) / ms.length(E))*28; + + addChild(new BatimentQuadMur(me,height)); + addChild(new BatimentQuadMur(mw,height)); + addChild(new BatimentQuadMur(mn,height)); + addChild(new BatimentQuadMur(ms,height)); + return true; } void BatimentQuadBlock::triangulation() {