Search Results

Search found 18 results on 1 pages for 'rag'.

Page 1/1 | 1 

  • What causes Box2D revolute joints to separate?

    - by nbolton
    I have created a rag doll using dynamic bodies (rectangles) and simple revolute joints (with lower and upper angles). When my rag doll hits the ground (which is a static body) the bodies seem to fidget and the joints separate. It looks like the bodies are sticking to the ground, and the momentum of the rag doll pulls the joint apart (see screenshot below). I'm not sure if it's related, but I'm using the Badlogic GDX Java wrapper for Box2D. Here's some snippets of what I think is the most relevant code: private RevoluteJoint joinBodyParts( Body a, Body b, Vector2 anchor, float lowerAngle, float upperAngle) { RevoluteJointDef jointDef = new RevoluteJointDef(); jointDef.initialize(a, b, a.getWorldPoint(anchor)); jointDef.enableLimit = true; jointDef.lowerAngle = lowerAngle; jointDef.upperAngle = upperAngle; return (RevoluteJoint)world.createJoint(jointDef); } private Body createRectangleBodyPart( float x, float y, float width, float height) { PolygonShape shape = new PolygonShape(); shape.setAsBox(width, height); BodyDef bodyDef = new BodyDef(); bodyDef.type = BodyType.DynamicBody; bodyDef.position.y = y; bodyDef.position.x = x; Body body = world.createBody(bodyDef); FixtureDef fixtureDef = new FixtureDef(); fixtureDef.shape = shape; fixtureDef.density = 10; fixtureDef.filter.groupIndex = -1; fixtureDef.filter.categoryBits = FILTER_BOY; fixtureDef.filter.maskBits = FILTER_STUFF | FILTER_WALL; body.createFixture(fixtureDef); shape.dispose(); return body; } I've skipped the method for creating the head, as it's pretty much the same as the rectangle method (just using a cricle shape). Those methods are used like so: torso = createRectangleBodyPart(x, y + 5, 0.25f, 1.5f); Body head = createRoundBodyPart(x, y + 7.4f, 1); Body leftLegTop = createRectangleBodyPart(x, y + 2.7f, 0.25f, 1); Body rightLegTop = createRectangleBodyPart(x, y + 2.7f, 0.25f, 1); Body leftLegBottom = createRectangleBodyPart(x, y + 1, 0.25f, 1); Body rightLegBottom = createRectangleBodyPart(x, y + 1, 0.25f, 1); Body leftArm = createRectangleBodyPart(x, y + 5, 0.25f, 1.2f); Body rightArm = createRectangleBodyPart(x, y + 5, 0.25f, 1.2f); joinBodyParts(torso, head, new Vector2(0, 1.6f), headAngle); leftLegTopJoint = joinBodyParts(torso, leftLegTop, new Vector2(0, -1.2f), 0.1f, legAngle); rightLegTopJoint = joinBodyParts(torso, rightLegTop, new Vector2(0, -1.2f), 0.1f, legAngle); leftLegBottomJoint = joinBodyParts(leftLegTop, leftLegBottom, new Vector2(0, -1), -legAngle * 1.5f, 0); rightLegBottomJoint = joinBodyParts(rightLegTop, rightLegBottom, new Vector2(0, -1), -legAngle * 1.5f, 0); leftArmJoint = joinBodyParts(torso, leftArm, new Vector2(0, 1), -armAngle * 0.7f, armAngle); rightArmJoint = joinBodyParts(torso, rightArm, new Vector2(0, 1), -armAngle * 0.7f, armAngle);

    Read the article

  • What causes Box2D revolute joints to separate?

    - by nbolton
    I have created a rag doll using dynamic bodies (rectangles) and simple revolute joints (with lower and upper angles). When my rag doll hits the ground (which is a static body) the bodies seem to fidget and the joints separate. It looks like the bodies are sticking to the ground, and the momentum of the rag doll pulls the joint apart (see screenshot below). I'm not sure if it's related, but I'm using the Badlogic GDX Java wrapper for Box2D. Here's some snippets of what I think is the most relevant code: private RevoluteJoint joinBodyParts( Body a, Body b, Vector2 anchor, float lowerAngle, float upperAngle) { RevoluteJointDef jointDef = new RevoluteJointDef(); jointDef.initialize(a, b, a.getWorldPoint(anchor)); jointDef.enableLimit = true; jointDef.lowerAngle = lowerAngle; jointDef.upperAngle = upperAngle; return (RevoluteJoint)world.createJoint(jointDef); } private Body createRectangleBodyPart( float x, float y, float width, float height) { PolygonShape shape = new PolygonShape(); shape.setAsBox(width, height); BodyDef bodyDef = new BodyDef(); bodyDef.type = BodyType.DynamicBody; bodyDef.position.y = y; bodyDef.position.x = x; Body body = world.createBody(bodyDef); FixtureDef fixtureDef = new FixtureDef(); fixtureDef.shape = shape; fixtureDef.density = 10; fixtureDef.filter.groupIndex = -1; fixtureDef.filter.categoryBits = FILTER_BOY; fixtureDef.filter.maskBits = FILTER_STUFF | FILTER_WALL; body.createFixture(fixtureDef); shape.dispose(); return body; } I've skipped the method for creating the head, as it's pretty much the same as the rectangle method (just using a cricle shape). Those methods are used like so: torso = createRectangleBodyPart(x, y + 5, 0.25f, 1.5f); Body head = createRoundBodyPart(x, y + 7.4f, 1); Body leftLegTop = createRectangleBodyPart(x, y + 2.7f, 0.25f, 1); Body rightLegTop = createRectangleBodyPart(x, y + 2.7f, 0.25f, 1); Body leftLegBottom = createRectangleBodyPart(x, y + 1, 0.25f, 1); Body rightLegBottom = createRectangleBodyPart(x, y + 1, 0.25f, 1); Body leftArm = createRectangleBodyPart(x, y + 5, 0.25f, 1.2f); Body rightArm = createRectangleBodyPart(x, y + 5, 0.25f, 1.2f); joinBodyParts(torso, head, new Vector2(0, 1.6f), headAngle); leftLegTopJoint = joinBodyParts(torso, leftLegTop, new Vector2(0, -1.2f), 0.1f, legAngle); rightLegTopJoint = joinBodyParts(torso, rightLegTop, new Vector2(0, -1.2f), 0.1f, legAngle); leftLegBottomJoint = joinBodyParts(leftLegTop, leftLegBottom, new Vector2(0, -1), -legAngle * 1.5f, 0); rightLegBottomJoint = joinBodyParts(rightLegTop, rightLegBottom, new Vector2(0, -1), -legAngle * 1.5f, 0); leftArmJoint = joinBodyParts(torso, leftArm, new Vector2(0, 1), -armAngle * 0.7f, armAngle); rightArmJoint = joinBodyParts(torso, rightArm, new Vector2(0, 1), -armAngle * 0.7f, armAngle);

    Read the article

  • Giving background music to a webpage

    - by rag
    var musicsrc="jyothir2.mp3"; if (navigator.appName=="Microsoft Internet Explorer") document.write('<bgsound src='+'"'+musicsrc+'"'+' loop="infinite">') else document.write('<embed src=\"'+musicsrc+'\" hidden="true" border="0" width="20" height="20" autostart="true" loop="infinite">') friends my javascript( for background music) codes is producing a continuous music in IE but the music is not continuous in other browsers.. can anybody tell me why is it so?

    Read the article

  • Redirecting Page(php) using Jquery Timer

    - by rag
    i have tried this code to redirect a php page.but it s not working .can any body please tell me the solution(is there any changes needed in the body part of parent page?).... / / here am pasting the code(header part) / <script type="text/javascript" src="jquery/jquery-latest.pack.js"></script> <script type="text/javascript" src="jquery/jquery.timer.js"></script> <script type="text/javascript"> $(document).ready(function() { // This will hold our timer var myTimer = {}; // delay 3 seconds myTimer = $.timer(3000, function() { //redirect to home page window.location = "http://sys3/shinshiva9/shin_shiva/booking_table.php"; }); }); </script>

    Read the article

  • click-event doesn't fire if blur changes layout

    - by rag
    I have a form with blur-events bound to the required fields. Then there is a "Cancel" Button which simply calls an URL (button is an image with click-event). When leaving one of the required fields a warning is written to the page saying that field xy is required. - this causes a layout shift, meaning all the fields and the buttons are moved down a little bit because of the text inserted above. The tricky thing is this: when the focus is in an empty but required field and you click the cancel button, the required-warning is written to the screen but the click-event on the cancel button doesn't fire. I think this is due to the layout shift. The mouse cursor doesn't hover over the button anymore, because the button scrolled down. Has anyone a good idea how i could solve this?

    Read the article

  • PHP mysql_fetch_array

    - by rag
    $n=mysql_num_rows($rs); $i=0; while($n>0) { while(($row=mysql_fetch_array($rs))&&$i<=5) { echo $row['room_name']; $i=$i+1; //echo $n."<br>"; } echo "<br>"; //echo "n1=".$n; $n=$n-5; // $i=0; } Output:101102103104105106 108109110 The row for roomname 107 is missing.... anybody please tell me what is the problem while reentering the loop again...

    Read the article

  • Thesis theme adding a div

    - by rag
    how to add a div between headerarea and content area of a thesis theme. what is the code i need to be write in custom_functions.php file for these attempt...or which page i need to edit for that ....anybody please give an asnwer to me..

    Read the article

  • .htaccess for hiding url details

    - by rag
    Options +FollowSymlinks RewriteEngine on RewriteRule ^WR-(.*)\.html$ WR.php?act=show i have created .htaccess file to rewrite WR.php?act=show to .html extension and save this file in a folder where my source file are residing. but it is not working can anybody help me please....

    Read the article

  • echo-ing EURO symbol

    - by rag
    i have tried to copy euro symbol from Wikipedia...and echo it (in my parent page),at that time it is working.but when i replace the same html content using jquery(used same symbol to echo in the other page).it is not displaying.why is it so..(or is der any way to display the same thing using html)?

    Read the article

  • An internal error occurred during runtime. Smarty

    - by rag
    WARNING [2] include(somepath/templates_c/%%B0^B01^B019F522%%login.htm.php) [function.include]: failed to open stream: No such file or directory on Line No 1871 in somepath/Smarty.class.php Error!: An internal error occurred during runtime. Any body please tell me why this error is occuring..

    Read the article

  • Nokogiri and Special Characters

    - by Moe
    I'm using Nokogiri to grab the contents of the title tag on a webpage, but am having trouble with accented characters. What's the best way to deal with these? Here's what I'm doing: require 'open-uri' require 'nokogiri' doc = Nokogiri::HTML(open(link)) title = doc.at_css("title") At this point, the title looks like this: Rag\303\271 Instead of: Ragù How can I have nokogiri return the proper character (e.g. ù in this case)?

    Read the article

  • how Can we get the output format to CSV instead of HTML in Alfresco using webscripts?

    - by pavan123
    how Can we change the output format to CSV instead of HTML in Alfresco using webscripts? below are the my corresponding FTL and Webscript files recursive.get.html.ftl <#macro recurse_macro node depth> <#if node.isContainer> <tr> <td> ${node.properties.name} </td> <td></td> </tr> <#list node.children as child> <#if child.isContainer> <@recurse_macro node=child depth=depth+1/> <#list child.children as child2> <#if child2.isDocument> <tr><td></td><td>${child2.properties.name}</td></tr> </#if> </#list> </#if> </#list> </#if> </#macro> Recursive Listing of Spaces & Documents: Space Document recursive.get.desc.xml <webscript> <shortname>recurcive</shortname> <description>Recursive</description> <url>/sample/recursive/{recursive}</url> <format default="html">extension</format> <authentication>guest</authentication> </webscript> and html output is Recursive Listing of Spaces & Documents: Space Document Company Home Data Dictionary Space Templates Software Engineering Project Documentation Drafts Pending Approval Published Samples system-overview.html Discussions UI Design Presentations Quality Assurance Presentation Templates doc_info.ftl localizable.ftl my_docs.ftl my_spaces.ftl my_summary.ftl translatable.ftl recent_docs.ftl general_example.ftl my_docs_inline.ftl show_audit.ftl readme.ftl Email Templates notify_user_email.ftl invite_user_email.ftl RSS Templates RSS_2.0_recent_docs.ftl Saved Searches admin Scripts backup.js example test script.js backup and log.js append copyright.js alfresco docs.js test return value.js Web Scripts org alfresco sample blogsearch.get.js blogsearch.get.atom.ftl blogsearch.get.desc.xml blogsearch.get.html.ftl blogsearch.get.html.400.ftl blogsearch.get.atom.400.ftl categorysearch.get.js categorysearch.get.atom.ftl categorysearch.get.desc.xml categorysearch.get.html.ftl categorysearch.get.html.404.ftl categorysearch.get.atom.404.ftl folder.get.js folder.get.atom.ftl folder.get.desc.xml folder.get.html.ftl avmstores.get.desc.xml avmstores.get.html.ftl avmbrowse.get.js avmbrowse.get.desc.xml avmbrowse.get.html.ftl recursive.get.desc.xml recursive.get.html.ftl sgs.get.desc.xml sgs.get.csv.ftl sample1.get.desc.xml sample1.get.csv.ftl first.get.desc.xml first.get.text.ftl rag.get.html.ftl rag.get.desc.xml new1.get.desc.xml new1.get.html.ftl excel.get.html.ftl excel.get.desc.xml sgs1.get.desc.xml one.get.html.ftl one.get.desc.xml one.get.js readme.html Web Scripts Extensions readme.html Guest Home Alfresco-Tutorial.pdf User Homes isabel Users Home

    Read the article

  • Tips on combining the right Art Assets with a 2D Skeleton and making it flexible

    - by DevilWithin
    I am on my first attempt to build a skeletal animation system for 2D side-scrollers, so I don't really have experience of what may appear in later stages. So i ask advice from anyone that been there and done that! My approach: I built a Tree structure, the root node is like the center-of-mass of the skeleton, allowing to apply global transformations to the skeleton. Then, i make the hierarchy of the bones, so when moving a leg, the foot also moves. (I also make a Joint, which connects two bones, for utility). I load animations to it from a simple key frame lerp, so it does smooth movement. I map the animation hierarchy to the skeleton, or a part of it, to see if the structure is alike, otherwise the animation doesnt start. I think this is pretty much a standard implementation for such a thing, even if i want to convert it to a Rag Doll on the fly.. Now to my question: Imagine a game like prototype, there is a skeleton animation of the main character, which can animate all meshes in the game that are rigged the same way.. That way the character can transform into anything without any extra code. That is pretty much what i want to do for a side-scroller, in theory it sounds easy, but I want to know if that will work well. If the different people will be decently animated when using the same skeleton-animation pair. I can see this working well with a Stickman, but what about actual humans? Will the perspective look right, or i will need to dynamically change the sprites attached to bones? What do you recommend for such a system?

    Read the article

  • Will Online Learning Save Higher Education (and does it need saving)?

    - by user739873
    A lot (an awful lot) of education industry rag real estate has been devoted to the topics of online learning, MOOC’s, Udacity, edX, etc., etc. and to the uninitiated you’d think that the education equivalent of the cure for cancer had been discovered. There are certainly skeptics (whose voice is usually swiftly trampled upon by the masses) who feel we could over steer and damage or destroy something vital to teaching and learning (i.e. the classroom experience and direct interaction with human beings known as instructors), but for the most part prevailing opinion seems to be that online learning will take over the world and that higher education will never be the same. Now I’m sure that since you all know I work for a technology company you think I’m going to come down hard on the side of online learning proselytizers. Yes, I do believe that this revolution can and will provide access to massive numbers of individuals that either couldn’t afford (from a fiscal or time perspective) a traditional education, and that in some cases the online modality will actually be an improvement over certain traditional forms (such as courses taught by an adjunct or teaching assistant that has no business being a teacher). But I think several things need immediate attention or we’re likely to get so caught up in the delivery that we miss some of the real issues (and opportunities) around online learning. First and foremost, we’ve got to give some thought to how traditional information systems are going to accommodate thousands (possibly hundreds of thousands) of individual students each taking courses from many, many different “deliverers” with an expectation that successful completion of these courses will result in credit at many or most institutions. There’s also a huge opportunity to refine the delivery platform (no, LMS is not a commodity when you are talking about online delivery being your sole mode of operation) as well as the course itself by mining all kinds of data from the interactions that the students have with the material each time they take it. Social data analytics tools will be key in achieving this goal. What about accreditation (badging or competencies vs. traditional degrees)? And again, will the information systems in place today adapt to changes in this area fast enough? The type of scale that this shift in learning could drive has the potential to abruptly overwhelm just about every system in place today in higher education. I would like to (with a not so gentle reminder) refer you back to a blog entry I wrote when I first stepped into my current role at Oracle in which I talked about how higher ed needs an “Oracle” more than at any other time in it’s evolution (despite the somewhat mercantilist reputation it has in some circles). There just aren’t that many organizations that can deliver the kinds of solutions “at scale” that this brave new world of online education will demand. The future may be closer than we think. Cole

    Read the article

  • Form, function and complexity in rule processing

    - by Charles Young
    Tim Bass posted on ‘Orwellian Event Processing’. I was involved in a heated exchange in the comments, and he has more recently published a post entitled ‘Disadvantages of Rule-Based Systems (Part 1)’. Whatever the rights and wrongs of our exchange, it clearly failed to generate any agreement or understanding of our different positions. I don't particularly want to promote further argument of that kind, but I do want to take the opportunity of offering a different perspective on rule-processing and an explanation of my comments. For me, the ‘red rag’ lay in Tim’s claim that “...rules alone are highly inefficient for most classes of (not simple) problems” and a later paragraph that appears to equate the simplicity of form (‘IF-THEN-ELSE’) with simplicity of function.   It is not the first time Tim has expressed these views and not the first time I have responded to his assertions.   Indeed, Tim has a long history of commenting on the subject of complex event processing (CEP) and, less often, rule processing in ‘robust’ terms, often asserting that very many other people’s opinions on this subject are mistaken.   In turn, I am of the opinion that, certainly in terms of rule processing, which is an area in which I have a specific interest and knowledge, he is often mistaken. There is no simple answer to the fundamental question ‘what is a rule?’ We use the word in a very fluid fashion in English. Likewise, the term ‘rule processing’, as used widely in IT, is equally difficult to define simplistically. The best way to envisage the term is as a ‘centre of gravity’ within a wider domain. That domain contains many other ‘centres of gravity’, including CEP, statistical analytics, neural networks, natural language processing and so much more. Whole communities tend to gravitate towards and build themselves around some of these centres. The term 'rule processing' is associated with many different technology types, various software products, different architectural patterns, the functional capability of many applications and services, etc. There is considerable variation amongst these different technologies, techniques and products. Very broadly, a common theme is their ability to manage certain types of processing and problem solving through declarative, or semi-declarative, statements of propositional logic bound to action-based consequences. It is generally important to be able to decouple these statements from other parts of an overall system or architecture so that they can be managed and deployed independently.  As a centre of gravity, ‘rule processing’ is no island. It exists in the context of a domain of discourse that is, itself, highly interconnected and continuous.   Rule processing does not, for example, exist in splendid isolation to natural language processing.   On the contrary, an on-going theme of rule processing is to find better ways to express rules in natural language and map these to executable forms.   Rule processing does not exist in splendid isolation to CEP.   On the contrary, an event processing agent can reasonably be considered as a rule engine (a theme in ‘Power of Events’ by David Luckham).   Rule processing does not live in splendid isolation to statistical approaches such as Bayesian analytics. On the contrary, rule processing and statistical analytics are highly synergistic.   Rule processing does not even live in splendid isolation to neural networks. For example, significant research has centred on finding ways to translate trained nets into explicit rule sets in order to support forms of validation and facilitate insight into the knowledge stored in those nets. What about simplicity of form?   Many rule processing technologies do indeed use a very simple form (‘If...Then’, ‘When...Do’, etc.)   However, it is a fundamental mistake to equate simplicity of form with simplicity of function.   It is absolutely mistaken to suggest that simplicity of form is a barrier to the efficient handling of complexity.   There are countless real-world examples which serve to disprove that notion.   Indeed, simplicity of form is often the key to handling complexity. Does rule processing offer a ‘one size fits all’. No, of course not.   No serious commentator suggests it does.   Does the design and management of large knowledge bases, expressed as rules, become difficult?   Yes, it can do, but that is true of any large knowledge base, regardless of the form in which knowledge is expressed.   The measure of complexity is not a function of rule set size or rule form.  It tends to be correlated more strongly with the size of the ‘problem space’ (‘search space’) which is something quite different.   Analysis of the problem space and the algorithms we use to search through that space are, of course, the very things we use to derive objective measures of the complexity of a given problem. This is basic computer science and common practice. Sailing a Dreadnaught through the sea of information technology and lobbing shells at some of the islands we encounter along the way does no one any good.   Building bridges and causeways between islands so that the inhabitants can collaborate in open discourse offers hope of real progress.

    Read the article

  • CodeIgniter Third party class not loading

    - by Jatin Soni
    I am trying to implement Dashboard widget class (found here: http://harpanet.com/programming/php/codeigniter/dashboard/index#installation) but it is giving me error Unable to load the requested class I have tried to add this class in autoload as well as menually to my controller $this->load->library('dash') but this also giving the same error. I have checked dash.php and found below method private function __example__() but can't understand what the developer is saying in comment. class Dash { private function __example__() { /* * This function is purely to show an example of a dashboard method to place * within your own controller. */ // load third_party hArpanet dashboard library $this->load->add_package_path(APPPATH.'third_party/hArpanet/hDash/'); $dash =& $this->load->library('dash'); $this->load->remove_package_path(APPPATH.'third_party/hArpanet/hDash/'); // configure dashboard widgets - format: type, src, title, cols, alt (for images) $dash->widgets = array( array('type'=>'oop', 'src'=>'test_dash', 'title'=>'Test OOP Widget', 'cols'=>3), // if 'title' is set to FALSE, the title block is omitted entirely // note: this is an 'html' widget but is being fed content from a local method array('type'=>'html', 'src'=>self::test_method(), 'title'=>false, 'cols'=>3), array('type'=>'file', 'src'=>'saf_inv.htm', 'title'=>'Safety Investigation'), // multi-content widget - set widget title in outer array (also note use of CI anchor to create a link) array('title'=>anchor('tz', 'TARGET ZERO'), // sub-content follows same array format as single content widget // 'img' content can also have an 'alt' text array('type'=>'img', 'src'=>'saf_tzout.gif', 'alt'=>'Action Completed'), array('type'=>'file', 'src'=>'saf_tz.htm'), array('type'=>'file', 'src'=>'ave_close.htm', 'title'=>'Average Time to Close') ), array('type'=>'file', 'src'=>'saf_meet.htm', 'title'=>'Safety Meeting'), array('type'=>'file', 'src'=>'saf_acc.htm', 'title'=>'Accident Investigation'), array('type'=>'file', 'src'=>'saf_hazmat.htm', 'title'=>anchor('hazmat', 'HAZMAT')), array('type'=>'file', 'src'=>'saf_cont.htm', 'title'=>'Loss of Containment'), array('type'=>'file', 'src'=>'saf_worksinfo.htm', 'title'=>'Works Information'), // an action widget - 'clear' will generate a blank widget with a style of clear:both array('type'=>'clear'), // multi-content widget - width can be set using the 'cols' param in outer array array('title'=>'RAG Report', 'cols' => 2, array('type'=>'file', 'src'=>'saf_rag.htm'), array('type'=>'img', 'src'=>'ProcSaf.gif')), array('type'=>'file', 'src'=>'saf_chrom.htm', 'title'=>'Chrome checks'), ); // populate the view variable $widgets = $dash->build('safety'); // render the dashboard $this->load->view('layout_default', $widgets); } ................... } // end of Dash class Installation path is root/application/third_party/hArpanet/hDash/libraries/dash.php How can I load this class to my system and use widgets?

    Read the article

1